MailScanner archive question

Julian Field MailScanner at
Tue Apr 7 13:33:14 IST 2009

"To" and "Cc" users are identical from MailScanner's point of view. 
MailScanner doesn't use the contents of the "To" or "From" or "Cc" 
headers at all, it looks at the real recipients and senders of the 
message, which is all stored in the envelope.
So your rules will store the mail in all directories corresponding to 
every recipient of the messages, not just the ones that happen to be in 
your domain. The rule will fire if *any* recipient is in your domain, 
and will cause the message to be stored in the directory for *every* 
So if you use

To * 

then it will be stored in a separate directory for each domain. If you 
are not interested in any except those where _TODOMAIN_ ==, 
then just delete those directories every day on a cron job.

On 7/4/09 13:10, Jose Perez wrote:
> Hi People:
> I'm using MailScanner 4.74.16 with Archiving feature like this:
> Archive Mail = Archive Mail = %rules-dir%/mail.archiving.rules
> The content of %rules-dir%/mail.archiving.rules is this:
> To:       *
> /var/spool/MailScanner/archive/
> From:   *
> /var/spool/MailScanner/archive/
> This is working fine, all users that send and receive
> e-mail are getting their messages archived but MailScanner it's doing
> something I believe is wrong.
> Only when some external user (some user at Internet, outside
> sends a message to somebody of with CC
> (copies) to other people of external domains (i.e,
> then MailScanner is creating also a directory under
> /var/spool/MailScanner/archive/ with the name (only user
> part without of those users who received the copies but
> aren't, so I'm seeing how now exists more directories
> than users of under
> /var/spool/MailScanner/archive/
> I mean, if jvoorhees1 at send a message to admin at
> with CC to bgates at then MailScanner creates the file
> Received under the
> /var/spool/MailScanner/archive/
> How can I prevent MailScanner of creating directories of external users?
> I hope someone can give me some advice, thanks. Bye!


Julian Field MEng CITP CEng
Buy the MailScanner book at

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

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

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