Filename rule question
Glenn Steen
glenn.steen at gmail.com
Tue Jul 3 18:51:06 IST 2007
On 03/07/07, Marco Induni <minduni at ti-edu.ch> wrote:
> Hi All,
> I try to deny some email attachments based just on the filename.
> So I setup the following test rule to deny all attachment for email
> sended to me at pluto.com (obviously just a real address)
>
> - in /etc/MailScanner/Mailscanner.conf
> -- Filename Rules = %rules-dir%/filename-rules.rules
>
> - in /etc/MailScanner/rules/filename-rules.rules
> -- To: me at pluto.com /etc/MailScanner/filename-alldeny.conf
> -- FromOrTo: default
> /etc/MailScanner/filename-nocheck.rules.conf
>
> - in /etc/MailScanner/filename-alldeny.conf
> -- deny .* - -
>
> - in /etc/MailScanner/filename-nocheck.rules.conf
> -- allow .* - -
>
>
> So I expect that any attachment will be denied, but is not true.
> It seems that everything is passing through, and the rule is not
> matching anything.
> I've done MailScanner --lint and no syntax error appear.
> I've also tried the standard rules enclosed (deny .exe .reg,...), but
> didn't work.
When troubleshooting things like these, always doublecheck your
assumptions with MailScanner itself... Try "MailScanner --help" to see
the possible things you can do ... apart from the well-known --debug
and --lint (start by doing a lint... it'll show you any bad syntax
errors), you can also try any setting with any sender/receiver .... In
your case you'd test
MailScanner --value=filenamerules --from=anyone at example.net --to=me at pluto.com
and perhaps some variations ... Replace with addresses valid to your situation.
> Question, for the filename rule to work, should I always setup also the
> filetype rule ?
Almost always a good thing to do, yes. Check those with the same
strategy/commands.
> Any other ideas ?
> Where I'm wrong ?
Probably a typo. Might be related to those files needing to be <TAB>
separated...
Cheers
--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se
More information about the MailScanner
mailing list