Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
cat << 'EOL' >/etc/postfix/main.cf
#
# PostFix Config
 
##Modify Below [HOSTNAME] & [DOMAIN]
myhostname = [HOSTNAME]
mydomain = [DOMAIN.COM/NET/ORG]
 
##UnComment Relay
# G-Mail
#relayhost = [smtp.gmail.com]:587
# Comcast Residential
#relayhost = [smtp.comcast.net]:587
# Comcast Business
#relayhost = [smtp.hmc1.comcast.net]:587
# Outlook
#relayhost = [smtp.office365.com]:587 
# Entrust
#relayhost = [mail.eternatec.com]:587 
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_use_tls=yes
#smtp_tls_security_level = may
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls=yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +sender_canonical_maps
inet_interfaces = all
inet_protocols = ipv4
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
canonical#canonical_maps = hash:/etc/postfix/sender_canonical
mydestination = $myhostname.$mydomain $myhostname localhost
sender_canonical_maps = static:$myhostname@$mydomain
#sender_canonical_maps = regexp:/etc/postfix/sender_canonical
EOL

...

No Format
cat << EOL >/etc/postfix/sasl/sasl_passwd
[smtp.gmail.com]:587    username@gmail.com:password
EOL
chmod 600 /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/sasl/sasl_passwd

Comcast Residential

No Format
cat << EOL >/etc/postfix/sasl/sasl_passwd
[smtp.comcast.net]:587    username@comcast.net:password
EOL
chmod 600 /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/sasl/sasl_passwd

Comcast Business

No Format
cat << EOL >/etc/postfix/sasl/sasl_passwd
[smtp.hmc1.comcast.net]:587    username@domain.com:password
EOL
chmod 600 /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/sasl/sasl_passwd

Outlook:

No Format
cat << EOL >/etc/postfix/sasl/sasl_passwd
[smtp.office365.com]:587  username@domain.com:password
EOL
chmod 600 /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/sasl/sasl_passwd

Entrust:

No Format
cat << EOL >/etc/postfix/sasl/sasl_passwd
[mail.eternatec.com]:587  username@domain.com:password
EOL
chmod 600 /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/sasl/sasl_passwd

Configure TO: Field AKA Root Alias Mapping (Change user@example.com)

No Format
cat << EOL >/etc/aliases
postmaster:    root
root: user@example.com
trash: /tmp/mail.trash
EOL
newaliases
No Format
cat << 'EOL' >/etc/postfix/sender_canonical
root     user@domain.com
EOL

Configure PostMap DB for PASSWD & Alias

No Format
chmod 600 /etc/postfix/sasl/sasl_passwd
chown postfix:postfix /etc/postfix/ -R
postmap /etc/postfix/sasl/sasl_passwd
postmap /etc/postfix/canonical
newaliases
sender_canonical
No Format
service postfix restart

Ubuntu

...