diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-14 02:21:31 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-14 02:21:31 +0800 |
commit | a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e (patch) | |
tree | 72256e934f11cf8cfca74f860699d0b4a8c07943 /camel/providers/smtp | |
parent | da2d6ee08c364cbc4b99a7c2eb39678c350188f1 (diff) | |
download | gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar.gz gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar.bz2 gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar.lz gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar.xz gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.tar.zst gsoc2013-evolution-a60f38bc6e65a53c3598e9e22ebf5bfa3a76e27e.zip |
Replace the Bcc headers in a single location and don't flush the data
2001-10-13 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_data): Replace the
Bcc headers in a single location and don't flush the data unless
the write was successful.
svn path=/trunk/; revision=13662
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 54eecebde7..48972445e1 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -1002,7 +1002,7 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter)); camel_object_unref (CAMEL_OBJECT (crlffilter)); - /* copy the bcc headers */ + /* copy and remove the bcc headers */ header = CAMEL_MIME_PART (message)->headers; while (header) { if (!g_strcasecmp (header->name, "Bcc")) @@ -1012,8 +1012,21 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc"); + /* write the message */ ret = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream)); - if (ret == -1 || camel_stream_flush (CAMEL_STREAM (filtered_stream)) == -1) { + + /* add the bcc headers back */ + if (bcc) { + h = bcc; + while (h) { + camel_medium_add_header (CAMEL_MEDIUM (message), "Bcc", h->data); + g_free (h->data); + h = h->next; + } + g_slist_free (bcc); + } + + if (ret == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("DATA send timed out: message termination: " "%s: mail not sent"), @@ -1021,29 +1034,11 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi camel_object_unref (CAMEL_OBJECT (filtered_stream)); - if (bcc) { - h = bcc; - while (h) { - camel_medium_add_header (CAMEL_MEDIUM (message), "Bcc", h->data); - g_free (h->data); - h = h->next; - } - g_slist_free (bcc); - } - return FALSE; } + camel_stream_flush (CAMEL_STREAM (filtered_stream)); camel_object_unref (CAMEL_OBJECT (filtered_stream)); - if (bcc) { - h = bcc; - while (h) { - camel_medium_add_header (CAMEL_MEDIUM (message), "Bcc", h->data); - g_free (h->data); - h = h->next; - } - g_slist_free (bcc); - } /* terminate the message body */ |