diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-02-24 11:47:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-02-24 11:47:14 +0800 |
commit | fc1fc5f041bcd2d6446e988336061926a244e254 (patch) | |
tree | 2d0c0222faecf37c884c6c694d6952e326f58538 /camel/providers/smtp | |
parent | 6e61ef2ee4b9729c0122acc04127370b94edf4d6 (diff) | |
download | gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar.gz gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar.bz2 gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar.lz gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar.xz gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.tar.zst gsoc2013-evolution-fc1fc5f041bcd2d6446e988336061926a244e254.zip |
Do it the same way we just made the sendmail code do it.
2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_data): Do it the
same way we just made the sendmail code do it.
* providers/sendmail/camel-sendmail-transport.c
(sendmail_send_to): My last change but in a better way.
svn path=/trunk/; revision=20023
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 16a4749779..0acdfeb4d1 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -1222,11 +1222,10 @@ static gboolean smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, gboolean has_8bit_parts, CamelException *ex) { CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT; + struct _header_raw *header, *savedbcc, *n, *tail; char *cmdbuf, *respbuf = NULL; CamelStreamFilter *filtered_stream; CamelMimeFilter *crlffilter; - struct _header_raw *header; - GSList *n, *bcc = NULL; int ret; /* if the message contains 8bit/binary mime parts and the server @@ -1282,31 +1281,30 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, gboolean ha camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter)); camel_object_unref (CAMEL_OBJECT (crlffilter)); - /* copy and remove the bcc headers */ - header = CAMEL_MIME_PART (message)->headers; - while (header) { - if (!strcasecmp (header->name, "Bcc")) - bcc = g_slist_append (bcc, g_strdup (header->value)); - header = header->next; - } - - n = bcc; - while (n) { - camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc"); - n = n->next; + /* unlink the bcc headers */ + savedbcc = NULL; + tail = (struct _header_raw *) &savedbcc; + + header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers; + n = header->next; + while (n != NULL) { + if (!strcasecmp (header->name, "Bcc")) { + header->next = n->next; + tail->next = n; + n->next = NULL; + tail = n; + } else { + header = n; + } + + n = header->next; } /* write the message */ ret = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream)); - /* add the bcc headers back */ - while (bcc) { - n = bcc->next; - camel_medium_add_header (CAMEL_MEDIUM (message), "Bcc", bcc->data); - g_free (bcc->data); - g_slist_free_1 (bcc); - bcc = n; - } + /* restore the bcc headers */ + header->next = savedbcc; if (ret == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, |