Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. sender_canonical_classes = envelope_sender, header_sender
  2. sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps
  3. smtp_header_checks = regexp:/etc/postfix/header_check
  4.  
  5. /.+/ newsender@address.com
  6.  
  7. /From:.*/ REPLACE From: newsender@address.com
  8.  
  9. /etc/postfix/main.cf:
  10. smtp_generic_maps = hash:/etc/postfix/generic
  11.  
  12. /etc/postfix/generic:
  13. user@localdomain.local account@isp.example.com
  14. @localdomain.local wholedomain@isp.example.com
  15.  
  16. sudo postmap /etc/postfix/generic
  17. sudo /etc/init.d/postfix reload
  18.  
  19. # output of hostname -f - mail from local users appears to come from here
  20. myhostname = domU-01-02-03-04-05-06.compute-1.internal
  21. # Local delivery - include all 127.0.0.1 aliases from /etc/hosts
  22. mydestination = $myhostname, $mydomain, rest_of_entries_from_hosts
  23. # Needed for address translation to work
  24. myorigin = $mydomain
  25.  
  26. # Talking to MS Online
  27. # :submission = port 587
  28. relayhost = [smtp.mail.microsoftonline.com]:submission
  29. smtp_sasl_auth_enable = yes
  30. smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
  31. smtp_sasl_security_options = # Yes, leave empty
  32. smtp_tls_security_level = encrypt
  33. smtp_generic_maps = hash:/etc/postfix/generic
  34.  
  35. # Enable if you need debugging, but it does leak credentials to the log
  36. #debug_peer_level = 2
  37. #debug_peer_list = smtp.mail.microsoftonline.com
  38.  
  39. # Only listen on the local interfaces (not the public)
  40. inet_interfaces = localhost
  41.  
  42. # I left out a bunch of CentOS defaults. postconf -n is your friend.
  43. # These are included
  44. alias_maps = hash:/etc/aliases
  45. alias_database = hash:/etc/aliases
  46.  
  47. # Run postmap /etc/postfix/sasl_passwd after editing
  48. # Also, chown root:root; chmod 600
  49. smtp.mail.microsoftonline.com relayer@hosteddomain.com:YourP@ssw0rd
  50.  
  51. # Run postmap /etc/postfix/generic
  52. # I've seen local mail come from either source
  53. # output of dnsdomainname
  54. @compute-1.internal relayer@hosteddomain.com
  55. # output of hostname -f
  56. @domU-01-02-03-04-05-06.compute-1.internal relayer@hosteddomain.com
  57.  
  58. # Run newaliases after changing
  59. # Lot of stuff here. Mostly, just make sure the graph points to root, such as
  60. mailer-daemon: postmaster
  61. postmaster: root
  62.  
  63. # And the important part - your email or distribution group
  64. root: awsadmins@hosteddomain.com
  65.  
  66. # Sometimes it helps to expand the name, so email comes from 'root at aws host 5'
  67. # rather than just 'root'
  68. # Was
  69. #root:x:0:0:root:/root:/bin/bash
  70. # Is
  71. root:x:0:0:root on aws host 5:/root:/bin/bash
  72.  
  73. smtpd_sender_login_maps =
  74. hash:/etc/postfix/login-map
  75.  
  76. mail1@domain userlogin
  77. mail2@domain userlogin, otheruser@example.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement