[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@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@host.cell04.com"))
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.
--On Wednesday, October 06, 2004 6:58 PM +0300 Timo Sirainen tss@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.html
Ah, 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.
participants (2)
-
Kenneth Porter
-
Timo Sirainen