From 6ffa930086b903dbd8fed3543f5e4ed762b6e8d1 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Thu, 28 Jun 2001 20:35:43 +0000 Subject: Add a CamelMimeFilterStripHeader that removes a header from mime output. Used by sendmail to strip the BCC from the email while still sending to the BCC recipients. camel: 2001-06-28 Peter Williams * camel-mime-filter-stripheader.c: New file. Filter that strips a header from mime output. * camel-mime-filter-stripheader.h: New file. Header for the above. * providers/smtp/camel-smtp-transport.c (smtp_data): Use the stripheader filter to remove the "Bcc" header. * Makefile.am: Add the stripheader files. * tests/lib/Makefile.am (INCLUDES): Get this to compile again. * tests/mime-filter/test-stripheader.c: New file. Test suite for the CamelMimeFilterStripHeader. * tests/mime-filter/Makefile.am: New test section: mime filters. mail: 2001-06-28 Peter Williams * mail-ops.c (mail_send_message): Revert fejj's Bcc header removal; this unsets the BCC recipients and so doesn't send to the Bcc'd people at all. svn path=/trunk/; revision=10576 --- camel/providers/smtp/camel-smtp-transport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'camel/providers') diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 48b4250185..cf11499074 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -40,6 +40,7 @@ #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" @@ -911,7 +912,7 @@ smtp_data (CamelSmtpTransport *transport, CamelMedium *message, gboolean has_8bi /* now we can actually send what's important :p */ gchar *cmdbuf, *respbuf = NULL; CamelStreamFilter *filtered_stream; - CamelMimeFilter *crlffilter; + CamelMimeFilter *crlffilter, *bccfilter; /* if the message contains 8bit mime parts and the server doesn't support it, encode 8bit parts to the best @@ -955,7 +956,9 @@ 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)); if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream)) == -1) { -- cgit v1.2.3