MailScanner ignoring some rules

Julian Field MailScanner at
Thu Apr 3 21:17:27 IST 2008

I have just done a thorough test of a %rules-dir%/scan.messages.rules 
with 4 combinations:

FromOrTo: no
FromOrTo: default yes

FromOrTo: no
FromOrTo: default yes

FromOrTo: no
FromOrTo: default yes

FromOrTo: jkf at no
FromOrTo: default yes

with 2 messages. 1st from ntl at to jkf at, 2nd from 
jkf at to root at

In all combinations, it worked exactly as expected.

What I would like you to do is show me the output of the following 5 

ls -lu /etc/MailScanner/rules/scan.messages.rules
sleep 60
MailScanner --value=scanmessages --from=marketing at 
--to=root at localhost
MailScanner --value=scanmessages --from=root at localhost 
--to=marketing at
ls -lu /etc/MailScanner/rules/scan.messages.rules

Just cut and paste the whole block into your terminal window. It will 
take just over a minute to run. Cut and paste *all* the output into a 
reply to this message.

The 'sleep 60' is to force the MailScanner commands into the next minute 
on the clock. The "ls" commands will show the "last accessed" date stamp 
on rules file. If the rules file is being read at all, the 2nd ls will 
print a different date and/or time than the 1st ls. If it is not being 
read for some reason, the 2 ls commands will print the same date and time.

Then we'll be able to see what is going wrong with your setup.

Best regards,

TecnoWay Digital wrote:
> For example: %rules-dir%/scan.messages.rules then content of
> scan.messages.rules file is:
> FromOrTo:    marketing at    no
> FromOrTo:    default    yes
> On a server with mailscanner-4.46.2-2 (the rule works)
> but another server with mailscanner-4.68.8-1 the rule doesn't work
> the mailbox marketing at continue has still being processed by
> mailscanner.
> To certify that using the correct MailScanner.conf after upgrade, I'd 
> put a wrong set
> example "Sca Messages" and MailScanner report syntax error.
> Best Regards
> ----- Original Message ----- From: "Hugo van der Kooij" 
> <hvdkooij at>
> To: "MailScanner discussion" <mailscanner at>
> Sent: Thursday, April 03, 2008 2:29 AM
> Subject: Re: MailScanner ignoring some rules
>> Hash: SHA1
>> mailscanner at wrote:
>> | At MailScanner recent versions, when I set some rules like:
>> | Scan Messages = /etc/MailScanner/rules/scan.messages.rules
>> | or
>> | Filename Rules = /etc/MailScanner/filename.rules
>> |
>> | The MailScanner simply ignore the rules and don't print any error 
>> message.
>> Since you didn not include anything about the rules you have there we
>> must assume MS is right and your rules are wrong. In what way we can not
>> tell you by lack of any information.
>> Hugo.
>> - --
>> hvdkooij at     
>> PGP/GPG? Use:
>> A: Yes.
>> >Q: Are you sure?
>> >>A: Because it reverses the logical flow of conversation.
>> >>>Q: Why is top posting frowned upon?
>> Bored? Click on and rate those images.
>> Version: GnuPG v1.4.7 (GNU/Linux)
>> KnYl0Qt9kzlzy4m99EgvKhU=
>> =LsQL
>> -----END PGP SIGNATURE-----
>> -- 
>> MailScanner mailing list
>> mailscanner at
>> Before posting, read
>> Support MailScanner development - buy the book off the website! 


Julian Field MEng CITP CEng
Buy the MailScanner book 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