ESVA
ESVA
ESVA
1.7
Installation and
Administration Guide
Table of Contents
Getting Started............................................................................ 1
Introduction: .................................................................................... 1
Prerequisites: .................................................................................. 2
Software Prerequisites (one of the following): .........................................2
Hardware Prerequisites:.........................................................................2
Additional Prerequisites: ........................................................................2
Default Usernames and Passwords ................................................ 2
What’s new? ................................................................................... 3
Where has everything gone and what’s changed? ......................... 3
Item Location in MailWatch URL ............................................................3
Postgrey ................................................................................................3
FuzzyOCR .............................................................................................3
ESVA Setup ............................................................................... 5
VMware Host Setup ........................................................................ 5
Initial ESVA Setup........................................................................... 6
MailWatch Setup ............................................................................. 7
Securing the admin account ...................................................................7
Creating Domain Administrator accounts................................................7
Creating User Accounts .........................................................................7
Whitelisting and Blacklisting within MailWatch ........................................8
Greylist options ....................................................................................10
Configuring ESVA to relay to additional domains ..................................13
ESVA Upgrade/Migration .......................................................... 15
Which Procedure do I use?........................................................... 15
Upgrade Migration from ESVA 1.6 to ESVA 1.7....................................16
Migration from ESVA 1.7 to ESVA 1.7..................................................17
Extending the ESVA Quarantine Partition..................................... 19
Prerequisites ................................................................................. 19
Extending the Partition .................................................................. 20
Customizing your ESVA............................................................. 23
What’s to customize? .................................................................... 23
Disabling “Report as SPAM” footer ............................................... 23
Report as SPAM footer for Multiple Domains................................ 24
Report as HAM footer ................................................................... 24
Destination Address Verification on Incoming Mail ....................... 25
Document Location
This document is only valid on the day it was printed.
The current document can be found at:
http://www.global-domination.org/pdf/manual-esva-admin-17.pdf
Revision History
Date Version Summary of Changes Author
11/07/2007 0.1 Document Created Dave Waldron
25/07/2007 0.2 Minor formatting, Document info sections added, Pre-requisites updated, Andrew MacLachlan
URL for ESVA updated.
25/07/2007 0.3 Formatting to fix page numbers Dave Waldron
26/07/2007 1.0 General release. No changes Andrew MacLachlan
Disclaimer
While every attempt has been made to ensure the accuracy of the information
contained herein, the author disclaims all liability for any damages whatsoever
including direct or indirect, incidental, consequential, loss of business profits or
special damages, even if the author has been advised of the possibility of such
damages. The author disclaims all warranties, either expressed or implied, including
the warranties of suitability or fitness for a particular purpose.
Use the information in this document at your own risk. Use of the concepts,
examples, and/or other content of this document are entirely at your own risk.
All copyrights are owned by their owners, unless specifically noted otherwise. Use of
a term in this document should not be regarded as affecting the validity of any
trademark or service mark.
You are strongly recommended to take a backup of your system before major
installation and backups at regular intervals.
Credits and Acknowledgements
A big thank you to all the clever people that have contributed to the success of
ESVA over the last year – especially over the last six months since v 1.6 was released.
As is the nature of online forums the population tends to be transient, however that
doesn’t mean that the quality of advice, fixes and general discussion has suffered.
Because of the sheer amount of useful suggestions that have made their way into this
release I can’t thank everyone personally, however special thanks has to go to the
guys who made it all possible with the excellent software upon which ESVA is based:
For their efforts in assisting with the documentation the following get a special mention:
Dave Waldron – (Waldronmct) – The author of sizable portions of this document
Angelo McComis – (amccomis) – White/Blacklisting and filters
1
Getting Started
E SVA is a pre-built VMware Virtual Appliance that is free to download and use -
even the VMware software used to run it is free!
Introduction:
ESVA was born out of a need for organizations to have a cost-effective email virus & spam
scanning solution. There are other commercial products out there, but these are often too
expensive for small organizations to justify, or the existing free products are beyond the abilities
of these organizations.
ESVA is simply a pre-built and semi-configured email scanning (security) Virtual Appliance
(ESVA) that will run on VMware Workstation, Server, Player or ESX Server.
The idea is for the appliance to be pretty much set & forget with an easy to use interface so that
users don't really need to know how to use the underlying GNU/Linux.
1
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
Prerequisites:
Software Prerequisites (one of the following):
• VMware Server 1.0.2 for Windows or Linux
o Available for free at http://www.vmware.com/products/server/
• VMware Workstation 6.0
o Trial available at http://www.vmware.com/download/ws/eval.html
• VMware Player
o Available for free at http://www.vmware.com/download/player
• VMware Fusion for Mac OS X
o See http://www.vmware.com/products/desktop/fusion.html for details
• ESX V3 (VI3)
o Trial available at http://www.vmware.com/download/vi/eval.html
Hardware Prerequisites:
Minimum for Testing
Additional Prerequisites:
• A basic grasp of VMware principles and terminology
• Internet DNS MX records configured for your domain(s) pointing toward ESVA
(or the public interface of your firewall, with appropriate port forwarding
configured)
• A static IP Address for the ESVA appliance
• A DNS server for ESVA to resolve Internet addresses.
Important
All passwords should be changed from the defaults before ESVA is exposed to un-trusted
networks (e.g. Internet).
2
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
What’s new?
Most existing packages have been updated to more recent versions, including MailScanner,
ClamAV and SpamAssassin.
Postgrey
Has been replaced by SQLGrey
http://sqlgrey.sourceforge.net/
The SQLGrey Web Interface implementation in ESVA is based on SGWI (albeit heavily
modified), found here:
http://www.vanheusden.com/sgwi/
FuzzyOCR
FuzzyOCR has been implemented to catch the picture spam that makes it through the initial
filters.
http://fuzzyocr.own-hero.net/
3
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
4
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E Chapter
2
ESVA Setup
U nlike previous versions of ESVA, this version doesn’t have its network interface
configured to use DHCP out of the box. The initial setup is all done through the
ESVA Console directly via VMware.
5
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
6
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
After the last question is answered the changes are committed and your ESVA will reboot.
As soon as the Virtual Machine has rebooted it is ready to start processing mail. If you
make any mistakes during the initial setup, press <ctrl>-C to exit the setup program and
start again by typing esva-configure. Do NOT run esva-configure multiple times to
completion as this will result in a non-functioning ESVA server.
MailWatch Setup
Point your browser at http://the-ip-address-or-name-you-configured-esva-to-use.
7
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
Example 1:
Always accept mail from bob@example.co.uk illustrated at various user privilege levels.
Example 2:
Always reject mail from spammy@badhost.net, illustrated at various user privilege levels.
8
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
As a user, note again that the To: field cannot be modified. Mail from this address will be
blocked, but only blocked when sending to this user.
A Domain Administrator can block mail from this user across the entire domain.
Similar to Example 1, this might not be of much actual use in practice, but the system will
block an email address system-wide by putting in a blacklist entry at the System
Administrator user level.
9
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
Greylist options
When you click on the Greylist menu, a sub-menu opens below the main menu bar:
Greylisted
This screen lists all addresses that are awaiting verification. If an address isn’t validated
within 24hours it will be automatically removed from this list. You should keep an eye on
this list to capture any addresses or domains that are valid but don’t resend (common with
website forum notifications – notably the VMware VMTN forums). Addresses in this list
can be manually whitelisted or deleted by clicking on the appropriate link. It is also possible
to delete all entries before a specific time via the form at the bottom of the page.
AWL Addresses
Once an address has been validated, it is automatically whitelisted and appears in this list.
Addresses in this list can be deleted by clicking the delete link to the right of each address.
At the bottom of the screen, there is a form to manually add individual addresses to the
AWL. For the fields, follow the example below. The Source field is for the source IP
address in either class c notation (first 3 octets - xxx.xxx.xxx – this will allow messages to
be sent from any host within that class c address range) or class d notation (full IP address
– xxx.xxx.xxx.xxx)
It is important to note that some of the AWL addresses are class c and some are class d –
this is determined by SQLGrey and is a sign of how “trustworthy” an address is – A class d
is less trusted, and probably comes from dynamic address space or doesn’t have a matching
reverse lookup.
Also note that any spam that survives greylisting will be added to the AWL. In the
screenshot below the bottom address was a spam which was detected by and dealt with by
MailScanner. If successful spam comes from a particular host or domain regularly, you
should consider adding them to the Grey Domains or Grey Addresses lists to force a retry
on every message sent, doubling the effort required for them to send to your domains.
10
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
AWL Domains
Once a domain has sent messages from multiple source addresses to multiple destination
addresses, it will be auto whitelisted (and will appear in this list) – all senders from that
domain will be trusted to send to all recipients, as long as the source remains the same
(class c or d).
As for the AWL Addresses list, any domain can be deleted manually and entries can be
manually added as long as you have the correct source address and class.
White Domains
The domain that is referred to here is the domain in the FQDN determined by reverse
lookup, not the senders domain name. For example, company yyy sends all their mail
through their ISPs (zzz) smarthost. The mail ‘from address’ will be yyy.com, but the reverse
lookup on the mail server sending the message is zzz.com.
If you decide to trust all hosts that resolve to zzz.com hostnames, you can manually add
zzz.com to the white domain list.
As with additions, domains can be deleted as well.
White Addresses
This is similar to the White Domains list, however is for specific servers rather than entire
domains.
Grey Domains
If you get a lot of spam from a particular domain or sub-domain, you can force all hosts on
that domain to be permanently greylisted, meaning they won’t be automatically whitelisted.
11
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
Grey Addresses
This is similar to the Grey Domains list, however is for specific servers rather than entire
domains.
12
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
This will open up the page shown below. If you like, you can read through the file,
but the all configuration is done at the bottom.
This will cause Postfix to deliver all messages from allowed hosts to domains that don’t
have a transport mapping (i.e. outbound messages to external domains) directly. To change
this so that ESVA will forward all these messages to a smarthost (e.g. your ISPs smarthost)
you should replace the default entry to read like this:
* smtp:isp-smarthost.isp.net
13
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
To route messages for your own domains, use a similar format to the next line in the file
(below):
global-domination.org smtp:[192.168.169.98]
Repeat this process for all the domains you wish to relay to/for and click the update
button. The changes will be made effective instantly.
A much more detailed explanation is in the transport file if you require more information.
14
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E Chapter
3
ESVA Upgrade/Migration
E SVA is a built to be upgraded in future releases. Additionally, you can migrate from
previous versions (1.6) to the current version (1.7) to ease upgrades in the future.
Depending on how large your quarantine is, you might need to follow the
procedure to extend your /var filesystem (documented both at http://www.global-
domination.org/ESVA/howto/howto-esvabigdisk.pdf and later in this manual) first. If you
followed that procedure for the 1.6 ESVA you will also need to extend your new 1.7 ESVA
by following the same procedure.
Important
Before you do ANYTHING ELSE, backup your ESVAs by shutting them down and
tarring or zipping them. This will be your rollback if it all goes wrong!
Please read this full procedure before proceeding with any of the steps!
This procedure requires use of the command line interface.
All databases on the destination server will be over-written by the imported databases.
15
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
16
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
17
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
18
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E Chapter
4
Extending the ESVA Quarantine Partition
T his guide will help you to create an extended quarantine disk in order to store more
messages on busy sites.
Thanks to all those who complained (so nicely!) about the appalling inaccuracies in
the predecessor to this document – especially to those who came back with suggestions on
how to improve the document!
Any comments or suggestions should be posted to the official ESVA forum at:
http://www.global-domination.org/forum/.
Prerequisites
• Sufficient free space for the new quarantine disk
• A basic grasp of VMware principles and terminology (for VMware Server)
• If using ESX server you really should be qualified to do so (VCP level)
19
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
Important
Before you do ANYTHING ELSE, backup your ESVAs by shutting them down and
tarring or zipping them. This will be your rollback if it all goes wrong!
Please read this full procedure before proceeding with any of the steps!
This procedure requires use of the command line interface.
Important
This procedure will require some downtime for your ESVA and will require 2 reboots of
the Virtual Machine.
20
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
21
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E
17. Confirm the success of the operation by typing df –h on the console as root. You
should see all your mount points and sizes displayed e.g. below:
[root@mail-gw ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3.3G 1.3G 1.8G 42% /
/dev/sda1 99M 11M 84M 11% /boot
/dev/shm 252M 38M 214M 16% /dev/shm
/dev/shm 252M 8.0K 252M 1% /var/spool/MailScanner/incoming
/dev/sdb1 32G 177M 30G 1% /var/spool/MailScanner/quarantine
[root@mail-gw ~]#
22
E M A I L S E C U R I T Y V I R T U A L A P P L I A N C E ( E S V A )
I N S T A L L A N D A D M I N I S T R A T I O N G U I D E Chapter
5
Customizing your ESVA
W hile the ESVA is usable (and very effective) immediately after reboot from the
initial configuration, there are some customizations, depending on your
environment, that may need to be made.
What’s to customize?
• Disabling “Report as SPAM”
• Making sure that the “Report as SPAM” link shows up on email for all of your
domains, not just the first one you initially set up.
• Email Address verification (destination) on incoming email.
23
Report as SPAM footer for Multiple Domains
When configuring ESVA for a single domain, all scanned email that is delivered as clean has a
link at the bottom of the email to report false negatives as SPAM. In an environment with
multiple domains, however, a few additional steps are required to place the link on email for
ALL domains.
1. Log into your ESVA using an SSH client (putty or similar) as the username created
during the setup process, then switch to the root account (type su-l and enter the
root password when prompted)
2. Edit the /etc/MailScanner/rules/sig.html.rules and/or sig.text.rules files:
[root@mail-gw ~]#nano –w /etc/MailScanner/rules/sig.html.rules
3. The file will only have 1 active line to begin with that we are concerned with here:
To: *@yourinitialdomain.com /etc/MailScanner/reports/en/inline.sig.in.html
4. Add a line for each domain you are accepting mail for:
#This rule will only come into force if the domain is specified in…
#From: *@domain1.com /etc/MailScanner/reports/domain1.sig.txt
To: *@yourdomain.com /etc/MailScanner/reports/en/inline.sig.in.html
To: *@yourotherdomain.com /etc/MailScanner/reports/en/inline.sig.in.html
To: *@yourthirddomain.com /etc/MailScanner/reports/en/inline.sig.in.html
To: default /etc/MailScanner/reports/en/inline.sig.out.html
You can also add an additional link to let the user report the message as HAM (not SPAM) in
order to help the system learn. In the existing system the user would have to navigate what may
be a 'confusing to a non-techie' system of screens to classify their email.
Although the admin user has the Message Operations screen they would have to decide for the
user which messages were which.
Follow the steps below to add a link to the sig.in files that allows the user to classify the current
message as *either* spam or ham.
--
This message was scanned by ESVA and is believed to be clean.
Click here to 'learn' this message as spam.
Click here to 'learn' this message as ham (not spam).
1. Log into your ESVA using an SSH client (putty or similar) as the username created
during the setup process, then switch to the root account (type su-l and enter the
root password when prompted)
2. Copy learn-msg.cgi to learn.spam.cgi and learn.ham.cgi
cp learn-msg.cgi learn.spam.cgi
cp learn-msg.cgi learn.ham.cgi
24
3. Modify the following in learn-ham.cgi
Change the --spam flag to --ham.
Change the success redirect url to learned-ham.html.
4. Modify the following in learn-spam.cgi
Change the success redirect url to learned-spam.html.
5. Copy learned.html to learned-spam.html and learned-ham.html in /var/www/html:
cp learned.html learned-spam.html
cp learned.html learned-ham.html
6. In learned-ham.html, modify the text to reflect the fact that you are learning ham.
7. Modify learned-spam.html to correct the word 'acheive'.
8. Modify inline.sig.in.txt and .html to include the additional link in
/etc/Mailscanner/reports/en: (or your language(s))
Click here to report this message as spam.
http://mail.mydomain.com/cgi-bin/learn-spam.cgi?id=$id
Click here to report this message as ham (not spam).
http://mail.mydomain.com/cgi-bin/learn-ham.cgi?id=$id
Postfix performs the address verification before it accepts the email in the first place. The
verification transaction takes less than a second to verify good vs. bad addresses, and it stores
them in a cache by doing the following:
helo mygateway.foo.bar
mail from: <postmaster>
rcpt to: <checkingrecipient>
-------??? RESPONSE ???------- (either 250 or 550)
rset
quit
250 = good, 550 = bad. These results are cached in the verify.db.
When initially configuring this feature, be sure to configure it in "warn" mode first to make
sure your target server supports it properly. Instructions on how to configure warn are at
the end of this section.
25
# Note: avoid hash files here. Use btree instead.
address_verify_map = btree:/var/postfix/verify
smtpd_recipient_restrictions = permit_mynetworks,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_destination,
check_recipient_access hash:/etc/postfix/recipient_access, check_policy_service inet:127.0.0.1:60000,
reject_unverified_recipient
The first line you add (after the comment) is the database that caches good and bad emails
as they are learned. The last line is where the invalid emails are rejected. This command
tells postfix to use the verify command on all incoming messages and reject invalid
recipients.
Once you have the above lines in main.cf, make sure you do the following:
mkdir /var/postfix.
chown postfix:postfix /var/postfix
service postfix reload
warn_if_reject reject_unverified_recipient
Instead of actually bouncing the message (or all messages if verify isn't working properly),
you will get a warning in maillog (grep for reject_warning in maillog). Once you are satisfied
that legitimate email would be getting through and only mail to invalid addresses are being
stopped, remove the warn_if_reject from the main.cf file and restart postfix again.
26