07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The reject_unlisted_recipient rule rejects messages sent to non-existing local users, which<br />

makes sense. Finally, the reject_non_fqdn_recipient rule rejects non-fully-qualified addresses;<br />

this makes it impossible to send an email to jean or jean@machine, and requires using the full<br />

address instead, such as jean@machine.falcot.com or jean@falcot.com.<br />

11.1.3.5. Restrictions Associated with the DATA Command<br />

The DATA command of SMTP is emitted before the contents of the message. It doesn't provide<br />

any information per se, apart from announcing what comes next. It can still be subjected to<br />

checks.<br />

smtpd_data_restrictions = reject_unauth_pipelining<br />

Example 11.10<br />

DATA checks<br />

The reject_unauth_pipelining directives causes the message to be rejected if the sending party<br />

sends a command before the reply to the previous command has been sent. This guards against a<br />

common optimization used by spammer robots, since they usually don't care a fig about replies<br />

and only focus on sending as many emails as possible in as short a time as possible.<br />

11.1.3.6. Applying Restrictions<br />

Although the above commands validate information at various stages of the SMTP exchange,<br />

Postfix only sends the actual rejection as a reply to the RCPT TO command.<br />

This means that even if the message is rejected due to an invalid EHLO command, Postfix knows<br />

the sender and the recipient when announcing the rejection. It can then log a more explicit<br />

message than it could if the transaction had been interrupted from the start. In addition, a<br />

number of SMTP clients do not expect failures on the early SMTP commands, and these clients<br />

will be less disturbed by this late rejection.<br />

A final advantage to this choice is that the rules can accumulate information during the various<br />

stages of SMTP; this allows defining more fine-grained permissions, such as rejecting a non-local<br />

connection if it announces itself with a local sender.<br />

11.1.3.7. Filtering Based on the Message Contents<br />

QUICK LOOK<br />

Regexp tables<br />

The /usr/share/doc/postfix-doc/examples/header_checks.gz file contains<br />

many explanatory comments and can be used as a starting point for creating<br />

the /etc/postfix/header_checks and /etc/postfix/body_checks files.<br />

The validation and restriction system would not be complete without a way to apply checks<br />

to the message contents. Postfix differentiates the checks applying on the email headers from<br />

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

261

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

Saved successfully!

Ooh no, something went wrong!