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.

Note that the SASL database was created in Postfix's directory. In order to ensure consistency,<br />

we also turn /etc/sasldb2 into a symbolic link pointing at the database used by Postfix, with<br />

the ln -sf /var/spool/postfix/etc/sasldb2 /etc/sasldb2 command.<br />

Now we need to configure Postfix to use SASL. First the postfix user needs to be added to the sasl<br />

group, so that it can access the SASL account database. A few new parameters are also needed to<br />

enable SASL, and the smtpd_recipient_restrictions parameter needs to be configured to allow<br />

SASL-authenticated clients to send emails freely.<br />

# Enable SASL authentication<br />

smtpd_sasl_auth_enable = yes<br />

# Define the SASL authentication domain to use<br />

smtpd_sasl_local_domain = $myhostname<br />

[...]<br />

# Adding permit_sasl_authenticated before reject_unauth_destination<br />

# allows relaying mail sent by SASL-authenticated users<br />

smtpd_recipient_restrictions = permit_mynetworks,<br />

permit_sasl_authenticated,<br />

reject_unauth_destination,<br />

[...]<br />

Example 11.15<br />

Enabling SASL in /etc/postfix/main.cf<br />

EXTRA<br />

Authenticated SMTP client<br />

Most email clients are able to authenticate to an SMTP server before sending<br />

outgoing messages, and using that feature is a simple maer of configuring<br />

the appropriate parameters. If the client in use does not provide that feature,<br />

the workaround is to use a local Postfix server and configure it to relay email<br />

via the remote SMTP server. In this case, the local Postfix itself will be the<br />

client that authenticates with SASL. Here are the required parameters:<br />

smtp_sasl_auth_enable = yes<br />

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd<br />

relay_host = [mail.falcot.com]<br />

The /etc/postfix/sasl_passwd file needs to contain the username and password<br />

to use for authenticating on the smtp.falcot.com server. Here's an example:<br />

[mail.falcot.com]<br />

joe:LyinIsji<br />

As for all Postfix maps, this file must be turned into /etc/postfix/sasl_<br />

passwd.db with the postmap command.<br />

Chapter 11 — Network Services: Postfix, Apache, NFS, Samba, Squid, LDAP<br />

267

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

Saved successfully!

Ooh no, something went wrong!