diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-30 04:50:27 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-30 04:56:21 +0800 |
commit | 481ec13e185810444cf252313752cacb6e0b1d03 (patch) | |
tree | 1198bea6dcef85d9a15b5827e05a80d98c725c13 /mail | |
parent | f5dda1db35cab0589ebfe37f71d96eedf4b16901 (diff) | |
download | gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar.gz gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar.bz2 gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar.lz gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar.xz gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.tar.zst gsoc2013-evolution-481ec13e185810444cf252313752cacb6e0b1d03.zip |
e_mail_session_send_to(): Don't silently ignore if we can't send.
If sending fails for any reason, return a suitable GError. Don't just
return silently. Also check for a wider range of errors indicating the
service is unavailable in composer_send_completed(). This will trigger
the "save-to-outbox" info alert.
(cherry picked from commit 13089f0d5088cf138697121a0839bd7d3ed85e42)
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-composer-utils.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 3e2d3c3595..9edcb122a6 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -515,6 +515,7 @@ composer_send_completed (EMailSession *session, AsyncContext *context) { GError *error = NULL; + gboolean service_unavailable; gboolean set_changed = FALSE; e_mail_session_send_to_finish (session, result, &error); @@ -525,6 +526,23 @@ composer_send_completed (EMailSession *session, goto exit; } + /* Check for error codes which may indicate we're offline + * or name resolution failed or connection attempt failed. */ + service_unavailable = + g_error_matches ( + error, CAMEL_SERVICE_ERROR, + CAMEL_SERVICE_ERROR_UNAVAILABLE) || + /* XXX camel_getaddrinfo() sets this, unfortunately. */ + g_error_matches (error, CAMEL_ERROR, CAMEL_ERROR_GENERIC); + if (service_unavailable) { + /* Inform the user. */ + e_alert_run_dialog_for_args ( + GTK_WINDOW (context->composer), + "mail-composer:saving-to-outbox", NULL); + e_msg_composer_save_to_outbox (context->composer); + goto exit; + } + /* Post-processing errors are shown in the shell window. */ if (g_error_matches (error, E_MAIL_ERROR, E_MAIL_ERROR_POST_PROCESSING)) { EAlert *alert; |