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.

11.1.3.3. Accepting or Refusing Based on the Announced Sender<br />

Every message has a sender, announced by the MAIL FROM command of the SMTP protocol;<br />

again, this information can be validated in several different ways.<br />

smtpd_sender_restrictions =<br />

check_sender_access hash:/etc/postfix/access_sender,<br />

reject_unknown_sender_domain, reject_unlisted_sender,<br />

reject_non_fqdn_sender<br />

Example 11.8<br />

Sender checks<br />

The /etc/postfix/access_sender table maps some special treatment to some senders. This<br />

usually means listing some senders into a white list or a black list.<br />

The reject_unknown_sender_domain rule requires a valid sender domain, since it is needed<br />

for a valid address. The reject_unlisted_sender rule rejects local senders if the address does not<br />

exist; this prevents emails from being sent from an invalid address in the falcot.com domain,<br />

and messages emanating from joe.bloggs@falcot.com are only accepted if such an address really<br />

exists.<br />

Finally, the reject_non_fqdn_sender rule rejects emails purporting to come from addresses<br />

without a fully-qualified domain name. In practice, this means rejecting emails coming from<br />

user@machine: the address must be announced as either user@machine.example.com or<br />

user@example.com.<br />

11.1.3.4. Accepting or Refusing Based on the Recipient<br />

Each email has at least one recipient, announced with the RCPT TO command in the SMTP<br />

protocol. These addresses also warrant validation, even if that may be less relevant than the<br />

checks made on the sender address.<br />

smtpd_recipient_restrictions = permit_mynetworks,<br />

reject_unauth_destination, reject_unlisted_recipient,<br />

reject_non_fqdn_recipient<br />

Example 11.9<br />

Recipient checks<br />

reject_unauth_destination is the basic rule that requires outside messages to be addressed to<br />

us; messages sent to an address not served by this server are rejected. Without this rule, a server<br />

becomes an open relay that allows spammers to sent unsolicited emails; this rule is therefore<br />

strongly recommended, and it will be located near the beginning of the list for preference, so<br />

as to avoid other rules to authorize the message to pass through before its destination has been<br />

checked.<br />

260 The Debian Administrator's Handbook

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

Saved successfully!

Ooh no, something went wrong!