[Mimedefang] When do added headers become visible?

David F. Skoll dfs at roaringpenguin.com
Fri Jun 18 16:57:31 EDT 2004


On Fri, 18 Jun 2004, Mike Batchelor wrote:

> I'm trying to add a X-Is-A-Bounce: 1 header to emails with a null sender,
> so that a custom SpamAssassin rule can use that header to help decide
> whether the message is a bounce or not.

SpamAssassin will never see that header, because the function:

	action_add_header(...)

just makes a *note* in a special file.  After all the Perl processing
has finished, the C glue code reads the note and asks Sendmail to add the
header.

If you want SpamAssassin to actually see the header, you need to re-write
INPUTMSG, something like this but with error checking:

	open(OUT, ">INPUTMSG.new");
	print OUT "X-Is-A-Bounce: 1\n";
	open(IN, "<INPUTMSG");
	while(<IN>) {
		print(OUT);
	}
	close(IN);
	close(OUT);
	rename("INPUTMSG.new", "INPUTMSG");

and then call SpamAssassin.  As you can imagine, this is rather expensive.

--
David.



More information about the MIMEDefang mailing list