Professional Documents
Culture Documents
MailScanner.conf
NAME
SYNOPSIS
DESCRIPTION
System Settings
Incoming Work Dir Settings
Quarantine and Archive Settings
Process Incoming Mail
Options specific to Sophos Anti-Virus
Virus scanning and vulnerability testing
Options specific to ClamAV Anti-Virus
Removing/Logging dangerous or potentially offensive content
Attachment filename checking
Reports and responses
Changes to message headers
Notifications back to the senders of blocked messages
Changes to subject line
Changes to the message body
Mail archiving and monitoring
Notices to system administrators
Definitions of virus scanners and spam detectors
Spam detection and spam lists (DNS blocklists)
SpamAssassin
What to do with spam
System logging
Advanced SpamAssassin Settings
Advanced Settings
RULESETS
ATTACHMENT FILENAME RULESET
SEE ALSO
NAME
SYNOPSIS
none
DESCRIPTION
Linux: /etc/MailScanner
FreeBSD: /usr/local/etc/MailScanner
Other: /opt/MailScanner/etc
Blank lines are ignored, as are leading and trailing spaces. Comments
start at a ’#’ character and extend to the end of the line. All options are
expressed in the form
option = value
Many of the options can also be the filename of a ruleset, which can be
used to control features depending on the addresses of the message,
and/or the IP address where the message came from. You will find some
examples of rulesets and an explanation of them in the "rules" directories
within the MailScanner installation and in the section "RULESETS" later
in this manpage.
The options are best listed in a few categories. If this list looks very large
then don’t worry, the supplied MailScanner.conf file (or
MailScanner.conf.sample) contains sensible defaults for all the values.
You will probably only need to change a very few of them to start with.
% report−dir%
Default: /opt/MailScanner/etc/reports/en
Default FreeBSD: /usr/local/share/MailScanner/reports/en
% etc−dir%
Default: /opt/MailScanner/etc
Default FreeBSD: /usr/local/etc/MailScanner
% rules−dir%
Default: /opt/MailScanner/etc/rules
Default FreeBSD: /usr/local/etc/MailScanner/rules
% org−name%
Default: yoursite
Enter the full name of your organisation below, this is used in the
signature placed at the bottom of report messages sent by
MailScanner. It can include pretty much any text you like. You
can make the result span several lines by including "0
sequences in the text. These will be replaced by line−breaks.
% web−site%
Default: www.your−organisation.com
System Settings
Max Children
Default: 5
Run as User
Run as Group
Default: 5
Default: /var/spool/mqueue.in
1. a directory
name.
Example: /var/spool/mqueue.in
Example: /var/spool/mqueue.in/*
3. the name of a file containing a list of directory names,
which can in turn contain wildcards.
Example: /usr/local/etc/MailScanner/mqueue.in.list.conf
Default: /var/spool/mqueue
Default: /opt/MailScanner/var/incoming
Default FreeBSD: /var/spool/MailScanner/incoming
Quarantine Dir
Default: /opt/MailScanner/var/quarantine
Default FreeBSD: /var/spool/MailScanner/quarantine
PID file
Default: /opt/MailScanner/var/MailScanner.pid
Default FreeBSD: /var/run/MailScanner.pid
Default: 14400
MTA Default:
sendmail
Sendmail
Default: /usr/lib/sendmail
Default FreeBSD: /usr/sbin/sendmail
Sendmail2
You should not normally need to touch these settings at all, unless you are
You should not normally need to touch these settings at all, unless you are
using ClamAV and need to be able to use the external archive unpackers
instead of ClamAV’s built−in ones.
Default:
Default:
Default: 0600
Quarantine User
Default:
Quarantine Group
Default:
Quarantine Permissions
Default: 0600
Default: 100000000
This setting limits the total size of messages per batch for which
no scanning is done (i.e. Virus Scanning = no).
Default: 50000000
This setting limits the total size of messages per batch for which
scanning is done (i.e. Virus Scanning = yes).
Default: 100
This setting limits the total number of messages per batch for
which no scanning is done (i.e. Virus Scanning = no).
Default: 100
This setting limits the total number of messages per batch for
which scanning is done (i.e. Virus Scanning = yes).
Default: 1000
If more messages are found in the queue than this, then switch
to an "accelerated" mode of processing messages. This will
cause it to stop scanning messages in strict date order, but in
the order it finds them in the queue. If your queue is bigger than
this size a lot of the time, then some messages could be greatly
delayed. So treat this option as "in emergency only".
Default: 200
Expand TNEF
Default: yes
Default: no
TNEF Expander
Default: /opt/MailScanner/bin/tnef
Default FreeBSD: /usr/local/bin/tnef
TNEF Timeout
Default: 120
File Command
Default: /usr/bin/file
File Timeout
Default: 20
Unrar Command
Default: /usr/bin/unrar
Unrar Timeout
Default: 50
Default: no
This is inteded for use with a ruleset to ensure that none of your
users is covertly mailing sites with which you would not normally
communicate (e.g. your competitors). If this is set to yes (or the
ruleset evaluates to yes) encrypted messages are blocked.
Default: no
Default: 0
Default: −1
Default: 3
Default:
The first version will match "corrupt format not supported" only.
The second version will match "corrupt" and "format not
supported".
Default: /usr/local/Sophos/ide
The directory (or a link to it) containing all the Sophos *.ide files.
This is only used by the "sophossavi" virus scanner, and is
irrelevant for all other scanners.
Sophos Lib Dir
Default: /usr/local/Sophos/lib
The directory (or a link to it) containing all the Sophos *.so
libraries.This is only used by the "sophossavi" virus scanner,
and is irrelevant for all other scanners.
Default: /usr/local/Sophos/ide/*ides.zip
Virus Scanning
Default: yes
Do you want to scan email for viruses? A few people don’t have
virus scanner licence and so want to disable all the virus
scanning.
NOTE: Switching this to no completely disables all
virus−scanning functionality. If you just want to switch of actual
virus scanning, then set "Virus Scanners = none" instead.
If you want to be able to switch scanning on/off for different
users or different domains, set this to the filename of a ruleset.
Virus Scanners
Default: none
Note for McAfee users: Do NOT use any symlinks with McAfee
at all. It is very strange but McAfee may not detect all viruses
when started from a symlink or scanning a directory path
including symlinks.
Note: If you want to use multiple virus scanners, then this should
be a space−separated list of virus scanners.
Note: Make sure that you check that the base installation
directory in the 3rd column of virus.scanners.conf matches the
location you have installed each of your virus scanners. The
supplied virus.scanners.conf file assumes the default installation
locations recommended by each of the virus scanner installation
guides.
Default: 300
Default: yes
Silent Viruses
Default: no
Non−Forging Viruses
Strings listed here will be searched for in the output of the virus
scanners. It works to achieve the opposite effect of the "Silent
Viruses" listed above. If a string here is found in the output of the
virus scanners, then the message will be treated as if it were not
infected with a "Silent Virus". If a message is detected as both
a silent virus and a non−forging virus, then the non−forging
status will override the silent status. In simple terms, you should
list virus names (or parts of them) that you know do *not* forge
the From address. A good example of this is a document macro
virus or a Joke program. Another word that can be put in this list
is the special keyword "Zip−.Password". Inserting this will cause
senders to be warned about password−protected zip files, whey
they are not allowed.
Default: /usr/local/share/clamav/*.cvd
Default: 5
Default: 10000000
Default: 250
Default: no
Default: no
Default: yes
Default: yes
Default: %etc−dir%/phishing.safe.sites.conf
Default: no
• disarm => Allow these tags, but stop these tags from
working
Default: no
Default: disarm
• disarm => Allow these tags, but stop these tags from
working
Default: no
• disarm => Allow these tags, but stop these tags from
working
Allow WebBugs
Default: disarm
• disarm => Allow these tags, but stop these tags from
working
Default: no
• disarm => Allow these tags, but stop these tags from
working
Convert Dangerous HTML To Text
Default: no
Default: no
Default: no
Do you want to allow <Form> tags in email messages? This is
a bad idea as these are used as scams to pursuade people to
part with credit card information and other personal data. This
can also be the filename of a ruleset.
Filename Rules
Default: %etc−dir%/filename.rules.conf
Filetype Rules
Default: %etc−dir%/filetype.rules.conf
Quarantine Infections
Default: yes
Default: yes
Default: no
Default: no
Default: no
Language Strings
Default: %reports−dir%/languages.conf
Set where to find all the strings used so they can be translated
into your local language. This can also be the filename of a
ruleset so you can produce different languages for different
messages.
Default: %reports−dir%/deleted.filename.message.txt
Default: %reports−dir%/deleted.virus.message.txt
Default: %reports−dir%/stored.filename.message.txt
Default: /%reports−dir%/deleted.content.message.txt
Default: %reports−dir%/stored.content.message.txt
Disinfected Report
Default: %reports−dir%/disinfected.report.txt
Default: %reports−dir%/inline.sig.html
Default: %reports−dir%/inline.sig.txt
Default: %reports−dir%/sender.error.report.txt
Default: %reports−dir%/sender.filename.report.txt
Default: %reports−dir%/sender.virus.report.txt
When an attachment is removed because of a virus, this
message is sent back to the sender.
Default: yes
When this option is set, the full directory in which the virus was
found will be removed from report messages sent to users. This
makes the infection reports a lot easier to understand.
Default: yes
Mail Header
Default: X−MailScanner:
Spam Header
Default: X−MailScanner−SpamCheck:
Default: X−MailScanner−SpamScore:
If the option "Spam Score" is set, this is the name of the header
that is used to contain the list of characters.
Information Header
Default: X−MailScanner−Information:
Default: yes
Default: no
Default: X−%org−name%−MailScanner−From:
Evelope To Header
Default: X−%org−name%−MailScanner−To:
Default: yes
If this is set to yes then you get the normal fully detailed spam
report in spam messages. If this is set to no then you simply get
a "spam" or "not spam" report. The exact text inserted can be
configured in the languages.conf file for your language.
Default: yes
Default: s
If the option "Spam Score" is set, this is the character that will
be repeated in the "Spam Score Header", one letter for each
point in the SpamAssassin score.
Default: no
Default: 0
Default: Disinfected
Multiple Headers
Default: append
Hostname
Default: no
Default: no
Default: yes
Default: yes
Default:
Default: yes
Default: yes
Default: yes
Default: yes
Default: no
Default: no # end
Default: {Scanned}
This is the text inserted at the start or the end of the Subject: line
if the "Scanned Modify Subject" option above is in effect.
Default: yes
Default: {Virus?}
This is the text inserted at the start of the "Subject:" line if the
"Virus Modify Subject" option is set.
Default: yes
Default: {Virus?}
This is the text inserted at the start of the "Subject:" line if the
"Filename Modify Subject" option is set.
Default: yes
Default: {Filename?}
This is the text inserted at the start of the "Subject:" line if the
"Content Modify Subject" option is set.
Default: yes
If HTML tags in the message were "disarmed" by using the
HTML "Allow" options above with the "disarm" settings, do you
want to modify the subject line? This can also be the filename of
a ruleset.
Default: {Disarmed}
This is the text to add to the start of the subject if the "Disarmed
Modify Subject" option is set. This can also be the filename of a
ruleset.
Default: yes
Default: {Spam?}
This is the text to add to the start of the subject if the "Spam
Modify Subject" option is set. The exact string "_SCORE_" will
be replaced by the numeric SpamAssassin score. This can also
be the filename of a ruleset.
Default: yes
Default: {Spam?}
This is just like the "Spam Subject Text" option above, except
that it applies then the score from SpamAssassin is higher than
the "High SpamAssassin Score" value. The exact string
"_SCORE_" will be replaced by the numeric SpamAssassin
score. This can also be the filename of a ruleset.
Warning Is Attachment
Default: yes
Default: %org−name%−Attachment−Warning.txt
Default: ISO−8859−1
This is the name of the encoding character set used for the
contents of "VirusWarning.txt" attachments.
Default:
The files (option 3) are using the "mbox" format suitable for
most Unix mail systems. These files must already exist since
MailScanner will not create them!
If you give this option a ruleset, you can control exactly whose
mail is archived or forwarded. If you do this, beware of the legal
implications as this could be deemed to be illegal interception
unless the police have asked you to do this.
Any of the items above can contain the magic string _DATE_ in
them which will be replaced with the current date in yyyymmdd
format. This will make archive−rolling and maintenance much
easier, as you can guarantee that yesterday’s mail archive will
not be in active use today.
Send Notices
Default: yes
Default: no
When this option is set, the full directory in which the virus was
found will be removed from report messages sent to
administrators. This makes the infection reports a lot easier to
understand. It is also very useful if your notices go to your
customer sites.
Notice Signature
Notices From
Default: MailScanner
The visible part of the email address used in the "From:" line of
the notices. The <user@domain> part of the email address is
set to the "Local Postmaster" setting.
Notices To
Default: postmaster
Local Postmaster
Default: postmaster
When virus warnings are sent to any users, this is the email
address used as the "From:" header in the messages.
Default: %etc−dir%/spam.lists.conf
This file contains all the definitions of the "Spam Lists" (also
known as RBL’s or DNSBL’s) which can be used to try to detect
spam based on where each message came from. Many more
spam lists can be added to this file, but it contains the most
popular ones to get you started.
Default: %etc−dir%/virus.scanners.conf
This file contains the locations of all the commands that are run
for each virus scanner. Check this file before starting
MailScanner to make sure it will run the correct command or
wrapper script.
Spam Checks
Default: yes
If this option is set, messages will be checked to see if they are
spam.
Spam List
Default:
Default: 1
Default: 5
If a message appears in at least this number of "Spam Lists"
(as defined above), then the message will be treated as "High
Scoring Spam" and so the "High Scoring Spam Actions" will
happen. You probably want to set this to 2 if you are actually
using this feature. 5 is high enough that it will never happen
unless you use lots of "Spam Lists". This can also be the
filename of a ruleset.
Default: 10
Default: 7
Default: 10
Is Definitely Spam
Default: no
Default: no
Default: 20
Spammers have learnt that they can get their message through
by sending a message with lots of recipients, one of which
chooses to whitelist everything coming to them, including the
spammer. So if a message arrives with more than this number
of recipients, ignore the "Is Definitely Not Spam" whitelist.
SpamAssassin
Use SpamAssassin
Default: no
Default: 90000
Default: 6
Default: 20
Default: %etc−dir%/spam.assassin.prefs.conf
SpamAssassin Timeout
Default: 30
Default: 20
Default: 30
Default: yes
Default: no
Spam Score
Default: yes
Default: 0
Default: no
Spam Actions
Default: deliver
Default: deliver
Default: deliver
Default: %reports−dir%/sender.spam.report.txt
Default: %reports−dir%/sender.spam.rbl.report.txt
Default: %reports−dir%/sender.spam.sa.report.txt
Default: %reports−dir%/inline.spam.warning.txt
Default: %reports−dir%/recipient.spam.report.txt
If you use the ’notify’ Spam Action or High Scoring Spam Action
If you use the ’notify’ Spam Action or High Scoring Spam Action
then this is the location of the notification message that is sent
to the original recipients of the message.
Default: %rules−dir%/bounce.rules
You can use this ruleset to enable the "bounce" Spam Action.
You must *only* enable this for mail from sites with which you
have agreed to bounce possible spam. Use it on low−scoring
spam only (<10) and only to your regular customers for use in
the rare case that a message is mis−tagged as spam when it
shouldn’t have been. Beware that many sites will automatically
delete the bounce messages created by using this option
unless you have agreed this with them in advance.
System logging
Syslog Facility
Default: mail
Log Speed
Default: no
Do you want to log the processing speed for each section of the
code for a batch? This can be very useful for diagnosing speed
problems, particularly in spam checking.
Log Spam
Default: no
Default: no
Default: no
Default: no
Log all the filenames that are allowed by the Filetype Rules, or
just the filetypes that are denied? This can also be the filename
of a ruleset.
Default: no
Default: no
Log all occurrences of HTML tags found in messages, that can
be blocked. This will help you build up your whitelist of message
sources for which particular HTML tags should be allowed, such
as mail from newsletters and daily cartoon strips. This can also
be the filename of a ruleset.
If you are using Postfix you may well need to use some of the settings
below, as the home directory for the "postfix" user cannot be written to by
the "postfix" user. You may also need to use these if you have installed
SpamAssassin somewhere other than the default location.
Default:
mkdir /var/spool/MailScanner/spamassassin
chown postfix.postfix /var/spool/MailScanner/spamassassin
Default:
Default:
• prefix/etc/spamassassin
• prefix/etc/mail/spamassassin
• /usr/local/etc/spamassassin
• /etc/spamassassin
• /etc/mail/spamassassin
Default:
• prefix/share/spamassassin
• /usr/local/share/spamassassin
• /usr/share/spamassassin
Advanced Settings
Default: %d
When putting the value of the spam score of a message into the
headers, how do you want to format it. If you don’t know how to
use sprintf() or printf() in C, please *do not modify* this value.
This can also be the filename of a ruleset. A few examples for
you:
%d ==> 12
%5.2f ==>
12.34
%05.1f ==>
012.3
Debug
Default: no
Not for use by normal users. Setting this option to "yes" will put
MailScanner into debugging mode, in which it creates slightly
more output and will not become a daemon.
Debug SpamAssassin
Default: no
Run In Foreground
Default: no
LDAP Server
Default:
LDAP Base
Default:
LDAP Site
Default:
Default: no
Deliver in Background
Default: yes
Lockfile Dir
Default: /tmp
This is the directory in which lock files are placed to stop the
virus scanners used while they are in the middle of updating
themselves with new virus definitions. If you change this at all,
you will need to edit the "autoupdate" scripts for all your virus
scanners.
Default: /opt/MailScanner/lib/MailScanner/CustomFunctions
Default FreeBSD:
/usr/local/lib/MailScanner/MailScanner/CustomFunctions
Lock Type
Do not set this option to anything unless you know exactly what
you are doing. For sendmail and Exim, MailScanner will choose
the correct value by default. This affects how mail queue files
are locked, and your mail will be totally screwed up if you set
this option to anything other than the correct value for your MTA.
So leave it alone and let MailScanner choose the correct value
for you.
Default: supported
Are you using Exim with split spool directories? If you don’t
understand this, the answer is probably "no". Refer to the
Exim documentation for more information about split spool
directories.
Default: no
RULESETS
All blank lines are ignored, and comments start with "#" and continue to
the end of the line, like this: # This line is just a comment
Other than that, every line is a rule and looks like this example: From:
john.doe@domain.com yes
FromOrTo:
FromAndTo:
The syntax of these is very loosely defined. Any word containing "from",
any word containing "to", any word containing "from" and "to" (in either
order), and any word containing "and" will work just fine. You can put them
in upper or lower case, it doesn’t matter. And any additional punctuation
will be ignored.
2. The pattern describes what messages should match this rule. Some
examples are:
3. The result value is what you could have put in the entry in the main
mailscanner.conf file had you not given the filename of a ruleset instead.
See the file EXAMPLES for a few ideas on how to do things with this
system.
The rules are matched in order from the top to the bottom of the file, and
the first rule containing a matching regular expression is used. Each line
of the file is either blank, a comment (in which case it starts with a ’#’
character) or is a rule made up of 4 fields separated by one or more TAB
characters:
allow / deny
Accept or reject the attachment if its filename matches the
regular expression
regular expression
log text
If the rule matches, this text is placed in the syslog. If the text is
"−", no string is logged.
user text
If the rule matches, this text is placed in the text message sent to
the user. If the text is "−", no text is used.
SEE ALSO
MailScanner(8)
MailScanner would like to thank the following for their support: