Skip to content

Instantly share code, notes, and snippets.

@levnovikov
Created June 1, 2017 14:12
Show Gist options
  • Save levnovikov/5c99ff149dabdcd629d76302a97e4afb to your computer and use it in GitHub Desktop.
Save levnovikov/5c99ff149dabdcd629d76302a97e4afb to your computer and use it in GitHub Desktop.
Postfix-Exchange
inet_interfaces = 1.1.1.1
mydestination =
myorigin = domain.com
local_recipient_maps =
local_transport = error:no local delivery
parent_domain_matches_subdomains = debug_peer_list smtpd_access_maps
# this file contains the list to relay for
relay_domains = domain1.com, domain2.com, domain3.com
# list of addresses/domains to accept mail for
relay_recipient_maps = cdb:/etc/postfix/relay_recipient_maps
# Seems OK
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
# Where to send mail for addresses/domains
transport_maps = cdb:/etc/postfix/transport_maps
#
# virtual_alias_maps = cdb:/etc/postfix/virtual
# mail for the first of the domains we accept for
info@domain1.com x
host@domain1.com x
root@domain1.com x
bill@domain1.com x
# Another Set of Users
info@domain2.com x
host@domain2.com x
root@domain2.com x
bill@domain2.com x
# Accept mail for anyone at domain3.com
@domain3.com x
# Mail to anyone at domain.com is sent via SMTP to this host
domain1.com smtp:smtp.domain.com
# Also mail to *.domain.com
.domain1.com smtp:[1.1.1.2]:25
# this user goes to a different host for delivery
root@domain1.com smtp:trap.domain.com:25
# Mail to anyone at domain.com is sent via SMTP to this host
domain2.com smtp:[2.2.2.2]:25
# Mail to anyone at domain.com is sent via SMTP to this host
domain3.com smtp:[3.3.3.3]:25
# Mail to anyone at domain.com is sent via SMTP to this host
domain3.com smtp:[4.4.4.4]:25
# bounce these
example.com error:we do not mail to them
hotmail.com error:we do not mail to them
microsoft.com error:we do not mail to them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment