Delete with MailScanner based on header

Julian Field MailScanner at
Wed May 13 23:18:50 IST 2009

On 13/05/2009 12:53, Alvaro Marín wrote:
> Hello,
> I'm using a plugin in SA that does an "eval:check_msg()" and adds a header
> with add_header. In that header there is information about the scanned
> mail (if it's spam
> or a virus).
> I see that isn't any option in MailScanner's configuration to do an
> action based on a header added by SA, something like "SpamAssassin Rule
> Actions", so I've thought to do a custom function for MailScanner to do it.
> The idea is see if this header has "virus" as value, and if this occurs,
> delete the message. Is this possible?
> Where are SA's headers stored (I see that $message->{headers} are
> original ones only)?
MailScanner does not allow SpamAssassin to modify the message. However, 
you can have a SA rule and then have a "header" action in the 
SpamAssassin Rule Actions setup.

SpamAssassin is the wrong tool for determining if a message is a virus. 
Maybe you want to use the "generic" virus scanner that MailScanner 
allows you to implement yourself?


Julian Field MEng CITP CEng
Buy the MailScanner book at
Follow me at

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
PGP public key:

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the MailScanner mailing list