Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Postfix Documentation
Previous Page Home Next Page

Configuring Postfix as primary or backup MX host for a remote site

This section presents additional configuration. You need to combine this with basic configuration information as discussed the first half of this document.

When your system is SECONDARY MX host for a remote site this is all you need:

 1 DNS:
 2     the.backed-up.domain.tld        IN      MX 100 your.machine.tld.
 3 
 4 /etc/postfix/
main.cf:
 5     
relay_domains = . . . the.backed-up.domain.tld
 6     
smtpd_recipient_restrictions = 
 7         
permit_mynetworks 
reject_unauth_destination
 8 
 9     # You must specify your NAT/proxy external address.
10     #
proxy_interfaces = 1.2.3.4
11 
12     
relay_recipient_maps = hash:/etc/postfix/relay_recipients
13 
14 /etc/postfix/relay_recipients:
15     [email protected]   x
16     [email protected]   x
17      . . .

When your system is PRIMARY MX host for a remote site you need the above, plus:

18 /etc/postfix/
main.cf:
19     
transport_maps = hash:/etc/postfix/transport
20 
21 /etc/postfix/transport:
22     the.backed-up.domain.tld       relay:[their.mail.host.tld]

Important notes:

  • Do not list the.backed-up.domain.tld in mydestination.

  • Do not list the.backed-up.domain.tld in virtual_alias_domains.

  • Do not list the.backed-up.domain.tld in virtual_mailbox_domains.

  • Lines 1-7: Forward mail from the Internet for "the.backed-up.domain.tld" to the primary MX host for that domain.

  • Line 10: This is a must if Postfix receives mail via a NAT relay or proxy that presents a different IP address to the world than the local machine.

  • Lines 12-16: Define the list of valid addresses in the "the.backed-up.domain.tld" domain. This prevents your mail queue from filling up with undeliverable MAILER-DAEMON messages. If you can't maintain a list of valid recipients then you must specify " relay_recipient_maps =" (that is, an empty value), or you must specify an "@the.backed-up.domain.tld x" wild-card in the relay_recipients table.

  • Line 22: The [] forces Postfix to do no MX lookup.

Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what lookup tables Postfix supports, use the command "postconf -m".

Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.

NOTE for Postfix < 2.2: Do not use the fallback_relay feature when relaying mail for a backup or primary MX domain. Mail would loop between the Postfix MX host and the fallback_relay host when the final destination is unavailable.

  • In main.cf specify " relay_transport = relay",
  • In master.cf specify "-o fallback_relay =" at the end of the relay entry.
  • In transport maps, specify "relay:nexthop..." as the right-hand side for backup or primary MX domain entries.

These are default settings in Postfix version 2.2 and later.

Postfix Documentation
Previous Page Home Next Page