Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sender_canonical_classes = envelope_sender, header_sender
- sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps
- smtp_header_checks = regexp:/etc/postfix/header_check
- /.+/ newsender@address.com
- /From:.*/ REPLACE From: newsender@address.com
- /etc/postfix/main.cf:
- smtp_generic_maps = hash:/etc/postfix/generic
- /etc/postfix/generic:
- user@localdomain.local account@isp.example.com
- @localdomain.local wholedomain@isp.example.com
- sudo postmap /etc/postfix/generic
- sudo /etc/init.d/postfix reload
- # output of hostname -f - mail from local users appears to come from here
- myhostname = domU-01-02-03-04-05-06.compute-1.internal
- # Local delivery - include all 127.0.0.1 aliases from /etc/hosts
- mydestination = $myhostname, $mydomain, rest_of_entries_from_hosts
- # Needed for address translation to work
- myorigin = $mydomain
- # Talking to MS Online
- # :submission = port 587
- relayhost = [smtp.mail.microsoftonline.com]:submission
- smtp_sasl_auth_enable = yes
- smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
- smtp_sasl_security_options = # Yes, leave empty
- smtp_tls_security_level = encrypt
- smtp_generic_maps = hash:/etc/postfix/generic
- # Enable if you need debugging, but it does leak credentials to the log
- #debug_peer_level = 2
- #debug_peer_list = smtp.mail.microsoftonline.com
- # Only listen on the local interfaces (not the public)
- inet_interfaces = localhost
- # I left out a bunch of CentOS defaults. postconf -n is your friend.
- # These are included
- alias_maps = hash:/etc/aliases
- alias_database = hash:/etc/aliases
- # Run postmap /etc/postfix/sasl_passwd after editing
- # Also, chown root:root; chmod 600
- smtp.mail.microsoftonline.com relayer@hosteddomain.com:YourP@ssw0rd
- # Run postmap /etc/postfix/generic
- # I've seen local mail come from either source
- # output of dnsdomainname
- @compute-1.internal relayer@hosteddomain.com
- # output of hostname -f
- @domU-01-02-03-04-05-06.compute-1.internal relayer@hosteddomain.com
- # Run newaliases after changing
- # Lot of stuff here. Mostly, just make sure the graph points to root, such as
- mailer-daemon: postmaster
- postmaster: root
- # And the important part - your email or distribution group
- root: awsadmins@hosteddomain.com
- # Sometimes it helps to expand the name, so email comes from 'root at aws host 5'
- # rather than just 'root'
- # Was
- #root:x:0:0:root:/root:/bin/bash
- # Is
- root:x:0:0:root on aws host 5:/root:/bin/bash
- smtpd_sender_login_maps =
- hash:/etc/postfix/login-map
- mail1@domain userlogin
- mail2@domain userlogin, otheruser@example.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement