Hello
>> I ran into an issue with my mail filtering which I solved by
>> activating "Broken lineStripping", which converts any CRLF to LF
>> from the input mail.
>>
>> I would like to know why LF is expected as a line terminator, in
>> particular because I thought that a MTA would feed an RFC 2822
>> compliant mail to dspam, therefore using CRLF.
> I think RFC 2822 (and 2821) are using using CR followed by LF.
Precisely :) The nominal case is CR followed by LF, so why does dspam
require LF only?
>> When doing something like "cat myCRLFmail | dspam --deliver=stdout"
>> (without Broken lineStripping of course), your mail is garbaged with
>> a mix of CRLF and LF and added colons.
> Added colons? Where? Usually DSPAM does not touch the message at all
> except two cases:
> 1) You have turned on Broken lineStripping
> 2) You are using DSPAM in daemon mode
Well, I have this behaviour with Broken lineStripping commented out,
and not using daemon mode.
> In daemon mode DSPAM will normalize the mail and replace wrong \n
> with \r\n.
> With Broken lineStripping DSPAM will remove broken ^M from lines
> while reading the message stream line by line.
What do you call "broken ^M"?
From the read_stdin function in agent_shared.c
/* Strip CR/LFs for admittedly broken mail servers */
if (_ds_match_attribute(agent_config, "Broken",
"lineStripping")) {
size_t len = strlen(buf);
while (len>1 && buf[len-2]==13) {
buf[len-2] = buf[len-1];
buf[len-1] = 0;
len--;
}
}
This converts CRLF to LF.
> If you have a mixed CRLF and LF in your message then your source
> was/is already broken and it's not DSPAM fiddeling around with the
> message at all. I say that because if you would use daemon mode
> then for sure there would not be a mixed CRLF and LF because the
> code would fix that into normalized CRLF.
My mail is piped by imapfilter to procmail, from an IMAP dovecot
server. It is RFC2822 compliant, that is with CRLF. Then my first
procmail recipe is to pipe to dspam. There is no mixed CRLF and LF in
the original message.
Here's an example:
$ cat -A testCRLF
Message-Id: <[email protected]>^M$
From: "Alice" <[email protected]>^M$
To: "Bob" <[email protected]>^M$
Subject: CRLF^M$
Date: Sun, 28 Aug 2011 15:26:23 +0200^M$
^M$
Test for dspam with CRLF^M$
$ cat testCRLF | dspam --deliver=stdout
Message-Id: <[email protected]>
From: "Alice" <[email protected]>
To: "Bob" <[email protected]>
Subject: CRLF
Date: Sun, 28 Aug 2011 15:26:23 +0200
:
: st for dspam with CRLF
X-DSPAM-Result: Innocent
X-DSPAM-Processed: Mon Aug 29 20:33:44 2011
X-DSPAM-Confidence: 0.9104
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: 4e5bdb88123901139819873
$ cat -A testLF
Message-Id: <[email protected]>$
From: "Alice" <[email protected]>$
To: "Bob" <[email protected]>$
Subject: LF$
Date: Sun, 28 Aug 2011 15:26:23 +0200$
$
Test for dspam with LF$
$ cat testLF | dspam --deliver=stdout
Message-Id: <[email protected]>
From: "Alice" <[email protected]>
To: "Bob" <[email protected]>
Subject: LF
Date: Sun, 28 Aug 2011 15:26:23 +0200
X-DSPAM-Result: Innocent
X-DSPAM-Processed: Mon Aug 29 20:37:48 2011
X-DSPAM-Confidence: 0.8364
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: 4e5bdc7c124583687219774
Test for dspam with LF
$ cat testCRLF | dspam --deliver=stdout > dspam.out
$ file dspam.out
dspam.out: ASCII text, with CRLF, CR, LF line terminators
$ cat -A dspam.out
Message-Id: <[email protected]>^M$
From: "Alice" <[email protected]>^M$
To: "Bob" <[email protected]>^M$
Subject: CRLF^M$
Date: Sun, 28 Aug 2011 15:26:23 +0200^M$
^M: $
Test for dspam with CRLF^M: $
X-DSPAM-Result: Innocent$
X-DSPAM-Processed: Mon Aug 29 20:38:51 2011$
X-DSPAM-Confidence: 0.9761$
X-DSPAM-Probability: 0.0000$
X-DSPAM-Signature: 4e5bdcbb124921353114664$
$
I observe this on Debian, running dspam
3.9.1~rc1+git20110514.347379b+dfsg-1.
Thanks
--
Sylvain
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Dspam-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-user