aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c37
2 files changed, 22 insertions, 21 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 30300365d2..91f1d02e5e 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2001-10-12 Jeffrey Stedfast <fejj@ximian.com>
* Makefile.am: Remove the stripheader filter from the build.
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 */