Kenneth Porter
2004-Oct-06 14:58 UTC
[Dovecot] Spaces removed from subjects in FETCH response
I'm using SpamAssassin to tag spam and prefix the spam score to the subject line. To make the scores sort properly in the client's message list, I pad the score with spaces to right-align it. It looks like dovecot-0.99.10.9-1.FC3.2 is frustrating this by stripping the excess spaces from the subject before reporting it in FETCH responses. Here's an actual subject line: Subject: (SPAM? 6.9) Urgent Response !! Note the multiple spaces before the "6.9". Here's the matching FETCH command and reply, as reported in Mulberry's IMAP.log (just the relevant message is shown here): A00035 FETCH 1507:1524 (FLAGS RFC822.SIZE UID INTERNALDATE ENVELOPE BODYSTRUCTURE) * 1517 FETCH (UID 1557 FLAGS (\Seen) INTERNALDATE "02-Oct-2004 12:24:40 -0700" RFC822.SIZE 6263 BODYSTRUCTURE (("text" "plain" ("charset" "us-ascii") NIL NIL "8bit" 1168 24 NIL ("inline" NIL) NIL)("message" "rfc822" ("x-spam-type" "original") NIL "original message before SpamAssassin" "8bit" 3855 ("Sat, 02 Oct 2004 13:52:28 -0400" "Urgent Response !!" (("Dr. Price" NIL "pkprice2i" "netscape.net")) (("Dr. Price" NIL "pkprice2i" "netscape.net")) (("Dr. Price" NIL "pkprice2i" "netscape.net")) NIL NIL NIL NIL "<E1CDo3Y-0002FZ-9f at host.cell04.com>") ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 2731 35 NIL NIL NIL) 63 NIL ("inline" NIL) NIL) "mixed" ("boundary" "----------=_415F007A.0DECCC93") NIL NIL) ENVELOPE ("Sat, 02 Oct 2004 13:52:28 -0400" "(SPAM? 6.9) Urgent Response !!" (("Dr. Price" NIL "pkprice2i" "netscape.net")) (("Dr. Price" NIL "pkprice2i" "netscape.net")) (("Dr. Price" NIL "pkprice2i" "netscape.net")) NIL NIL NIL NIL "<E1CDo3Y-0002FZ-9f at host.cell04.com>"))
Timo Sirainen
2004-Oct-06 15:58 UTC
[Dovecot] Spaces removed from subjects in FETCH response
On 6.10.2004, at 17:58, Kenneth Porter wrote:> It looks like dovecot-0.99.10.9-1.FC3.2 is frustrating this by > stripping the excess spaces from the subject before reporting it in > FETCH responses. Here's an actual subject line:Yes, and I think other servers do this as well. See the "Envelope mangling" thread in: http://www.faqchest.com/prgm/wuimap-l/imap-03/imap-0305/imap-030500/ and "the official conclusion": http://www.faqchest.com/prgm/wuimap-l/imap-03/imap-0305/imap-030500/ imap03052307_10796.html I still don't think it's necessarily such a good idea, but I'd rather not break it on purpose. You could anyway fix it by changing sources: Bottom of lib-imap/imap-quote.c : imap_quote_append(str, value, value_len, TRUE); change TRUE to FALSE. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20041006/6e00ce93/attachment-0001.bin>
Kenneth Porter
2004-Oct-06 17:05 UTC
[Dovecot] Spaces removed from subjects in FETCH response
--On Wednesday, October 06, 2004 6:58 PM +0300 Timo Sirainen <tss at iki.fi> wrote:> http://www.faqchest.com/prgm/wuimap-l/imap-03/imap-0305/imap-030500/ > > and "the official conclusion": > > http://www.faqchest.com/prgm/wuimap-l/imap-03/imap-0305/imap-030500/ > imap03052307_10796.htmlAh, found it in slightly more digestible form here: <http://www.washington.edu/imap/listarch/2003/msg00738.html>> I still don't think it's necessarily such a good idea, but I'd rather > not break it on purpose. You could anyway fix it by changing sources: > > Bottom of lib-imap/imap-quote.c : > > imap_quote_append(str, value, value_len, TRUE); > > change TRUE to FALSE.I agree, it's useful to preserve the original structure, and subjects breaking across lines should be the exception. I could see doing white space collapsing for white space across a line break, but I don't see any value in doing it mid-line. It would be great if this could be made a compile-time or config file setting. Meanwhile, I'll post back to the Mulberry and SpamAssassin lists about the issue.