How prevent sending mail to ISP when using default rDNS

From PeerFreedom Wiki
Jump to navigation Jump to search

There are some cases when misconfigured Postfix server can deliver your local mail to your ISP, when you are using default hostname obtained from your IP address by rDNS. For example 1.2.3.4.isp-domain.com.

Lets asume that your domain is your-domain.org.

To prevent any leakage set in /etc/postfix/main.cf:

parent_domain_matches_subdomains = smtpd_client_event_limit_exceptions
myhostname = 1.2.3.4.isp-domain.com
mydomain = your-domain.org
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost
relay_domains = $mydestination

You can also set virtual aliases for your local users, for example: root@your-domain.org -> you@your-domain.org