By default, the Postfix SMTP server will accept mail only from or to the local network or domain, so that your system can't be used as a mail relay to forward bulk mail from random strangers.
The text in this document describes how you can set up more detailed anti-UCE policies that prevent delivery of unwanted email altogether, for example with sendmail-style access lists or with RBL (real-time blackhole list) name servers.
Unless indicated otherwise, all parameters described here are in the main.cf file. If you change parameters of a running Postfix system, don't forget to issue a postfix reload command.
In addition to restrictions that are specific to HELO (EHLO)
command parameters, you can also specify restrictions based
on the client hostname or network address.
In addition to restrictions that are specific to sender mail
addresses, you can also specify restrictions based on the information
passed with the HELO/EHLO command, and on the client hostname or
network address.
In addition to restrictions that are specific to recipient mail
addresses, you can also specify restrictions based on the sender mail
address, on the information passed with the HELO/EHLO command, and
on the client hostname or network address.
In addition to restrictions that are specific to ETRN domain names,
you can also specify restrictions based on the information passed
with the HELO/EHLO command, and on the client hostname or network
address.
Note: RBL lookups are disabled by default.
A host or destination address matches $relay_domains when
its name or parent domain matches any of the names, files or lookup
tables listed in $relay_domains.
Client name/address restrictions
The smtpd_client_restrictions parameter restricts what
clients this system accepts SMTP connections from.
Require HELO (EHLO) command
The smtpd_helo_required parameter determines if clients must
send a HELO (EHLO) command at the beginning of an
SMTP session. Requiring this will stop some UCE software.
HELO (EHLO) hostname restrictions
The smtpd_helo_restrictions parameter restricts what hostnames
clients may send with the HELO (EHLO) command. Some
UCE software can be stopped by being strict here.
Sender address restrictions
The smtpd_sender_restrictions parameter restricts what sender
addresses this system accepts in MAIL FROM commands.
Recipient address restrictions
The smtpd_recipient_restrictions parameter restricts what
recipient addresses this system accepts in RCPT TO commands.
ETRN command restrictions
Not really an UCE restriction, the smtpd_etrn_restrictions
parameter restricts what domains may be specified in ETRN commands,
and what clients may issue ETRN commands.
Generic restrictions
The following restrictions can use used for client hostnames or
addresses, for HELO (EHLO) hostnames, for sender mail addresses
and for recipient mail addresses.
Additional UCE control parameters
Up one level | Basic
Configuration | UCE Controls | Rate
Controls | Resource Controls | Address Manipulation