07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

This new configuration is taken into account by running /etc/init.d/clamav-milter rest<br />

art.<br />

The standard ClamAV configuration fits most situations, but some important parameters can<br />

still be customized with dpkg-reconfigure clamav-base. Similarly, running dpkg-reconfig<br />

ure clamav-milter allows defining the mail filter's behavior in some detail.<br />

The last step involves telling Postfix to use the recently-configured filter. This is a simple matter<br />

of adding the following directive to /etc/postfix/main.cf:<br />

# Virus check with clamav-milter<br />

smtpd_milters = inet:[127.0.0.1]:10002<br />

If the antivirus causes problems, this line can be commented out, and /etc/init.d/postfix<br />

reload should be run so that this change is taken into account.<br />

IN PRACTICE<br />

Testing the antivirus<br />

Once the antivirus is set up, its correct behavior should be tested. The simplest<br />

way to do that is to send a test email with an aachment containing the<br />

eicar.com (or eicar.com.zip) file, which can be downloaded online:<br />

➨ http://www.eicar.org/anti_virus_test_file.htm<br />

This file is not a true virus, but a test file that all antivirus soware on the<br />

market diagnose as a virus to allow checking installations.<br />

All messages handled by Postfix now go through the antivirus filter.<br />

11.1.7. Authenticated SMTP<br />

Being able to send emails requires an SMTP server to be reachable; it also requires said SMTP<br />

server to send emails through it. For roaming users, that may need regularly changing the<br />

configuration of the SMTP client, since Falcot's SMTP server rejects messages coming from IP<br />

addresses apparently not belonging to the company. Two solutions exist: either the roaming<br />

user installs an SMTP server on their computer, or they still use the company server with some<br />

means of authenticating as an employee. The former solution is not recommended since the<br />

computer won't be permanently connected, and it won't be able to retry sending messages in<br />

case of problems; we will focus on the latter solution.<br />

SMTP authentication in Postfix relies on SASL (Simple Authentication and Security Layer). It requires<br />

installing the libsasl2-modules and sasl2-bin packages, then registering a password in the<br />

SASL database for each user that needs authenticating on the SMTP server. This is done with the<br />

saslpasswd2 command, which takes several parameters. The -u option defines the authentication<br />

domain, which must match the smtpd_sasl_local_domain parameter in the Postfix configuration.<br />

The -c option allows creating a user, and -f allows specifying the file to use if the<br />

SASL database needs to be stored at a different location than the default (/etc/sasldb2).<br />

# saslpasswd2 -h `postconf -h myhostname` -f /var/spool/postfix/etc/sasldb2 -c jean<br />

[... type jean's password twice ...]<br />

266 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!