[Mimedefang] Problem with ^M's and Razor
Nate Carlson
natecars at real-time.com
Tue Jun 4 16:22:10 EDT 2002
On Tue, 4 Jun 2002, David F. Skoll wrote:
> The "^M's" come from Sendmail, which dumps the message exactly as it
> was received. The SMTP RFC specifies that lines must end with CRLF,
> which is ^M^J.
>
> I'm surprised Razor is sensitive to line endings. You can get rid of
> them with some Perl code, I suppose:
>
> open(IN, "<INPUTMSG");
> open(OUT, ">RAZORMSG");
> while(<IN>) {
> $_ =~ tr/\015//d;
> print OUT;
> }
> close(IN);
> close(OUT);
>
> and then submit RAZORMSG to Razor (and check RAZORMSG against Razor!)
Hmm.. so this is really a Razor bug then, huh? :)
I did the following:
--- mimedefang.pl.orig Tue Jun 4 15:12:00 2002
+++ mimedefang.pl Tue Jun 4 15:20:44 2002
@@ -3418,9 +3418,13 @@
return undef;
}
+ my @msg;
+
open(IN, "<./INPUTMSG") or return undef;
- my @msg = <IN>;
- close(IN);
+ while(<IN>) {
+ $_ =~ tr/\015//d;
+ push(@msg,$_);
+ }
return Mail::SpamAssassin::NoMailAudit->new(data=>\@msg);
}
..which makes it return the proper Razor checksum.
I'll talk to the Razor guys and see if they can change the code to ignore
^M's..
--
Nate Carlson <natecars at real-time.com> | Phone : (952)943-8700
http://www.real-time.com | Fax : (952)943-8500
More information about the MIMEDefang
mailing list