Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Spamass-milter 0.2.0 includes a new feature that constructs a pseudo-Received header to provide SpamAssassin with additional useful data. Since incoming email is passed to the milter prior to SendMail adding its Received: headers, spamass-milter constructs a Received: header itself to pass to SpamAssassin so that SpamAssassin can take the information into consideration. This header is only used by SpamAssassin as spamass-milter does not send this header back to Sendmail. Sendmail continues to add its own header as it normally does. The following line is the code in spamass-milter that send the pseudo header to Spamassassin:

assassin->output((string)"Received: from "macro_s"("smfi_getsymval(ctx,"_")") by "smfi_getsymval(ctx,"j")"; "macro_b"\r\n");

macro_b is only available to spamass-milter if defined in Sendmail's configuration; in many situations it's not defined. As a result macro_b gets set to an empty string, but there is a space prior to macro_b which remains. The end result is a whitespace preceding the newline characters. In SpamAssassin's Received.pm we have the following:

my @rcvd = ($hdrs =~ /^(\S.+\S)$/gm);

...

This bug is currently fixed in the CVS version of spamass-milter, but no official release including the fix has been released at this time. To fix this you can either use the CVS version of the spamass-milter code or modify the code in spamass-milter.cpp to remove macro_b (since it's not terribly important) as shown below:

assassin->output((string)"Received: from "macro_s" ("smfi_getsymval(ctx,"_")") by "smfi_getsymval(ctx,"j")";\r\n");