Charles, > my upstream smtp provider is already running an anti-spam solution and i > therefore have messages coming in with a subject *** SPAM *** preceding > the original subject, and the provider leaves me no solution to stop it. > > i'd like to re-write the subject, eliminating the "*** SPAM ****" before > amavis has a look at it and before it trains bayes -- bayes (i think) > would start to notice that spam mails have a subject that is easy to > spot. > > i'm using postfix and would rather not have to try to develop a content > filter (for performance reasons) before handing the message to amavisd. > > is it possible to put perl code into the amavisd.conf to do this?
Inserting the following: $hdr_edits->edit_header('Subject', sub { $_[1] =~ /^\s*\*\*\* SPAM \*\*\*(.*)/s; $1 }); somewhere in sub add_forwarding_header_edits_common should do the trick. (a small caveat: haeder edits in versions up to 2.3.3 are not cumulative, so if it is later decided that some local spam tag should be inserted into subject line, the above edit request will be lost. This is improved in 2.4.0 (soon), which supports cumulative edits) Mark ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/