aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-07-12 06:30:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-07-12 06:30:51 +0800
commitde180f6cbbabda73d445f802e83e12696bffdab6 (patch)
treead2878824db97297218d37243c1c93a75f8d9b7e
parent2415667b55dc62ef5e7eab157e0dde5ce71a9598 (diff)
downloadgsoc2013-evolution-de180f6cbbabda73d445f802e83e12696bffdab6.tar.gz
gsoc2013-evolution-de180f6cbbabda73d445f802e83e12696bffdab6.tar.zst
gsoc2013-evolution-de180f6cbbabda73d445f802e83e12696bffdab6.zip
Fixes bug #27672
2002-07-11 Jeffrey Stedfast <fejj@ximian.com> Fixes bug #27672 * camel-mime-filter-bestenc.c: Conditionally #include <config.h> * camel-mime-filter-linewrap.c: Same here... although we could probably just get rid of this filter? We don't seem to use it anywhere since we try to QP/Base64 encode any text parts with long lines. Besides, we couldn't use this filter for SMTP anyway since we can't risk possibly linewrapping a binary mime part. I dunno, maybe this could be useful in the composer though? *shrug* * providers/smtp/camel-smtp-transport.c (smtp_data): Always call camel_mime_message_set_best_encoding() even if the server allows 8BITMIME and even if we don't have any 8bit parts because we may have parts with long lines (>998 octets) which also need to be encoded. * camel-mime-message.c (check_8bit): Don't forget to check for the binary encoding here as well. svn path=/trunk/; revision=17428
-rw-r--r--camel/ChangeLog22
-rw-r--r--camel/camel-mime-filter-bestenc.c5
-rw-r--r--camel/camel-mime-filter-linewrap.c7
-rw-r--r--camel/camel-mime-message.c6
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c17
5 files changed, 51 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index b546c95d6e..5812a37b84 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,27 @@
2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
+ Fixes bug #27672
+
+ * camel-mime-filter-bestenc.c: Conditionally #include <config.h>
+
+ * camel-mime-filter-linewrap.c: Same here... although we could
+ probably just get rid of this filter? We don't seem to use it
+ anywhere since we try to QP/Base64 encode any text parts with long
+ lines. Besides, we couldn't use this filter for SMTP anyway since
+ we can't risk possibly linewrapping a binary mime part. I dunno,
+ maybe this could be useful in the composer though? *shrug*
+
+ * providers/smtp/camel-smtp-transport.c (smtp_data): Always call
+ camel_mime_message_set_best_encoding() even if the server allows
+ 8BITMIME and even if we don't have any 8bit parts because we may
+ have parts with long lines (>998 octets) which also need to be
+ encoded.
+
+ * camel-mime-message.c (check_8bit): Don't forget to check for the
+ binary encoding here as well.
+
+2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
+
* providers/imap/camel-imap-folder.c (parse_fetch_response): If we
are fetching HEADERs, don't cache the stream - instead just create
a mem-stream and return that. This reduces a significant amount of
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index e53923344b..0de8abd04b 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -18,6 +18,11 @@
* Boston, MA 02111-1307, USA.
*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include "camel-mime-filter-bestenc.h"
diff --git a/camel/camel-mime-filter-linewrap.c b/camel/camel-mime-filter-linewrap.c
index 44d4755efb..c9a741dacf 100644
--- a/camel/camel-mime-filter-linewrap.c
+++ b/camel/camel-mime-filter-linewrap.c
@@ -19,9 +19,16 @@
* Boston, MA 02111-1307, USA.
*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <ctype.h>
+
#include "camel-mime-filter-linewrap.h"
+
static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
char **out, size_t *outlen, size_t *outprespace);
static void complete (CamelMimeFilter *f, char *in, size_t len,
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index fe62c84ed5..0b21d98a57 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -660,10 +660,14 @@ camel_mime_message_foreach_part (CamelMimeMessage *msg, CamelPartFunc callback,
static gboolean
check_8bit (CamelMimeMessage *msg, CamelMimePart *part, void *data)
{
+ CamelMimePartEncodingType encoding;
int *has8bit = data;
/* check this part, and stop as soon as we are done */
- *has8bit = camel_mime_part_get_encoding (part) == CAMEL_MIME_PART_ENCODING_8BIT;
+ encoding = camel_mime_part_get_encoding (part);
+
+ *has8bit = encoding == CAMEL_MIME_PART_ENCODING_8BIT || encoding == CAMEL_MIME_PART_ENCODING_BINARY;
+
return !(*has8bit);
}
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 7e5eddb6a0..b2b31bb922 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -39,7 +39,6 @@
#undef MIN
#undef MAX
#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-linewrap.h"
#include "camel-stream-filter.h"
#include "camel-smtp-transport.h"
#include "camel-mime-message.h"
@@ -1137,6 +1136,8 @@ static gboolean
smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, gboolean has_8bit_parts, CamelException *ex)
{
/* now we can actually send what's important :p */
+ CamelBestencRequired required = CAMEL_BESTENC_GET_ENCODING;
+ CamelBestencEncoding enctype = CAMEL_BESTENC_BINARY;
char *cmdbuf, *respbuf = NULL;
CamelStreamFilter *filtered_stream;
CamelMimeFilter *crlffilter;
@@ -1144,11 +1145,17 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, gboolean ha
GSList *h, *bcc = NULL;
int ret;
- /* if the message contains 8bit mime parts and the server
- doesn't support it, encode 8bit parts to the best
- encoding. This will also enforce an encoding to keep the lines in limit */
+ /* if the message contains 8bit/binary mime parts and the server
+ doesn't support it, set our required encoding to be 7bit */
if (has_8bit_parts && !(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
- camel_mime_message_encode_8bit_parts (message);
+ enctype = CAMEL_BESTENC_7BIT;
+
+ /* FIXME: should we get the best charset too?? */
+ /* Changes the encoding of any 8bit/binary mime parts to fit
+ within our required encoding type and also force any text
+ parts with long lines (longer than 998 octets) to wrap by
+ QP or base64 encoding them. */
+ camel_mime_message_set_best_encoding (message, required, enctype);
cmdbuf = g_strdup ("DATA\r\n");