[Users] Content-Encoding with long lines improvements

Colin Leroy colin at colino.net
Sun Apr 1 17:34:52 CEST 2012


On 01 April 2012 at 16h13, Christopher Zimmermann wrote:

Hi, 

> if (!strncmp("From ", outbuf, sizeof("From ")-1)) {
> 	gchar *tmpbuf = outbuf;
> 	
> 	tmpbuf += sizeof("From ")-1;
> 	
> 	if (fputs("=46rom ", outfp) == EOF)
> 		err = TRUE;
> 	if (fputs(tmpbuf, outfp) == EOF)
> 		err = TRUE;
> } else {

This is indeed a hack (but a rather standard one), to avoid MTAs
replacing lines starting with From in emails with ">From".

Some MTAs do that because of the MBOX format where each email starts
with a From line (which is distinct from the From: header), like

From sender at example.com
From: sender at example.com
To: rcpt at example.com
Subject: My subject

text a
text b
text c

From sender2 at example.com
...

Basically, in a stream-based approach, you'd have to search and replace
\nFrom with \n=46rom. You would, obviously, lose performance, but you
could special-case this for outgoing emails, as it's only useful when
sending.

Just curious, what do you want to improve ?

HTH,
-- 
Colin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20120401/f0c86e1a/attachment.sig>


More information about the Users mailing list