aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/smtp
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-13 06:45:10 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-13 06:45:10 +0800
commitdad441ba034c9c3b336a1af5b67c7e41f9bd9ad3 (patch)
tree26492bc4283ca0bef7dabb409ef79dec97d3b4a0 /camel/providers/smtp
parentc90ced3180e92eaa690eef03b9b709f16030fa0c (diff)
downloadgsoc2013-evolution-dad441ba034c9c3b336a1af5b67c7e41f9bd9ad3.tar.gz
gsoc2013-evolution-dad441ba034c9c3b336a1af5b67c7e41f9bd9ad3.tar.zst
gsoc2013-evolution-dad441ba034c9c3b336a1af5b67c7e41f9bd9ad3.zip
Remove the stripheader filter from the build.
2001-10-12 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Remove the stripheader filter from the build. * camel-mime-filter-stripheader.[c,h]: Removed. * providers/smtp/camel-smtp-transport.c (smtp_data): Check the return value of camel_stream_flush to make sure it flushed the data successfully before continuing. Don't use the stripheader filter, it was completely broken - instead remove the header and set it again after we send. svn path=/trunk/; revision=13641
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 000cdfe7f4..d88bd098db 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -40,7 +40,6 @@
#undef MIN
#undef MAX
#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-stripheader.h"
#include "camel-mime-filter-linewrap.h"
#include "camel-stream-filter.h"
#include "camel-smtp-transport.h"
@@ -950,9 +949,10 @@ static gboolean
smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bit_parts, CamelException *ex)
{
/* now we can actually send what's important :p */
- gchar *cmdbuf, *respbuf = NULL;
+ char *cc, *cmdbuf, *respbuf = NULL;
CamelStreamFilter *filtered_stream;
- CamelMimeFilter *crlffilter, *bccfilter;
+ CamelMimeFilter *crlffilter;
+ int ret;
/* if the message contains 8bit mime parts and the server
doesn't support it, encode 8bit parts to the best
@@ -996,14 +996,15 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi
/* setup stream filtering */
crlffilter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
- bccfilter = camel_mime_filter_stripheader_new ("Bcc");
filtered_stream = camel_stream_filter_new_with_stream (transport->ostream);
- camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (bccfilter));
camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter));
- camel_object_unref (CAMEL_OBJECT (bccfilter));
camel_object_unref (CAMEL_OBJECT (crlffilter));
- if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream)) == -1) {
+ cc = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "Cc"));
+ camel_medium_remove_header (CAMEL_MEDIUM (message), "Cc");
+
+ 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) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("DATA send timed out: message termination: "
"%s: mail not sent"),
@@ -1011,11 +1012,17 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi
camel_object_unref (CAMEL_OBJECT (filtered_stream));
+ camel_medium_set_header (CAMEL_MEDIUM (message), "Cc", cc);
+ g_free (cc);
+
return FALSE;
}
- camel_stream_flush (CAMEL_STREAM (filtered_stream));
camel_object_unref (CAMEL_OBJECT (filtered_stream));
+ if (cc) {
+ camel_medium_set_header (CAMEL_MEDIUM (message), "Cc", cc);
+ g_free (cc);
+ }
/* terminate the message body */