1 message in net.sourceforge.lists.courier-users[courier-users] Automimify 8bit-heade...
FromSent OnAttachments
Roland SchneiderMar 17, 2001 11:21 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Automimify 8bit-headers (patch)Actions...
From:Roland Schneider (rol@serv.ch)
Date:Mar 17, 2001 11:21:40 am
List:net.sourceforge.lists.courier-users

I was not happy passing all 8bit-headers just like qmail, so the following patch applies RFC2047 to some headers. 8bit-data in any other header will not be fixed/accepted.

--- courier-0.32.0.orig/courier/submit.C Mon Feb 5 07:26:55 2001 +++ courier-0.32.0/courier/submit.C Sat Mar 17 19:27:59 2001 @@ -9,6 +9,10 @@ #include "comcargs.h" #include "authlib/auth.h" #include "rfc822.h" + +// UNOFFICIAL PATCH: lib needed to mimify headers +#include "rfc2047.h" + #include "rfc1035/rfc1035.h" #include "rfc1035/rfc1035mxlist.h" #include "numlib/numlib.h" @@ -1001,6 +1005,19 @@ } rfc822a_free(rfca); rfc822t_free(rfcp); + } + + + // UNOFFICIAL PATCH: mimify 8bit in selected headers + + if ( headername == "subject" || headername == "to" + || headername == "from" || headername == "reply-to" ) + + { + char *mime = rfc2047_encode_str(header.GetBuffer(),"ISO-8859-1"); + header = ""; + header = mime; + free(mime); }

// Rewrite every RFC822 header we can find.

The second patch disables the need for MIME-headers with 8bit-data in the body. This is especially useful when sending mail via sendmail (from cron, logcheck, web-form) and there are no MIME-header. It would be better to silently add them, but I dont know and so I have to live with that for now :)

--- courier-0.32.0.orig/courier/submit2.C Tue Dec 5 14:14:51 2000 +++ courier-0.32.0/courier/submit2.C Sat Mar 17 19:04:00 2001 @@ -545,6 +545,9 @@ return (1); }

+ // UNOFFICIAL PATCH: ignore 8bit in body silently + // suggested action: add complete set for 8bit/plain + /* if (rwrfcptr->rfcviolation & RFC2045_ERR8BITCONTENT) { cout << @@ -554,6 +557,7 @@ "550 for more information.\n"; return (1); } + */

if (rwrfcptr->rfcviolation & RFC2045_ERR2COMPLEX) { @@ -581,7 +585,10 @@ if (rwrfcptr->has8bitchars) is8bit=1;

- if (!mime || strcmp(mime, "none")) + // UNOFFICIAL PATCH: set MIME=none as default + // because sendmail dont have the env from courier + + if ( mime && strcmp(mime, "none")) { if (mime && strcmp(mime, "7bit") == 0) {