[Mimedefang] spamassassin tests fix
Dirk Mueller
dmuell at gmx.net
Tue May 27 20:34:01 EDT 2003
Hi,
there is another small glitch: if the mail does not contain a To: Header,
mimedefang's spamassassin scores different from a normal spamassassin, which
will see the undisclosed-recipients header being added by sendmail.
below is the quick-hack patch. I'm not sure if the Header-To is supposed
to get set by the COMMANDS file / the C based header parser like it is done
for Subject and a few other headers. I can prepare a patch for that variant
if required. But this one should only be minimally slower.
--
Dirk
-------------- next part --------------
--- mimedefang.pl.orig 2003-05-28 02:13:36.000000000 +0200
+++ mimedefang.pl 2003-05-28 02:25:30.000000000 +0200
@@ -4991,11 +4991,16 @@
my @msg = <IN>;
close(IN);
- # Synthesize a "Return-Path", Message-ID and "Received:" header
+ open(IN, "./HEADERS") or return undef;
+ my @hto = grep { /^To:/i } <IN>;
+ close(IN);
+
+ # Synthesize a "Return-Path", Message-ID, To and "Received:" header
my @sahdrs;
push (@sahdrs, "Return-Path: $Sender\n");
push (@sahdrs, split (/^/m, &synthesize_received_header()));
push (@sahdrs, &gen_msgid_header()) if($MessageID eq "NOQUEUE");
+ push (@sahdrs, "To: undisclosed-recipients:;\n") if($#hto < 0);
unshift (@msg, @sahdrs);
More information about the MIMEDefang
mailing list