外寄郵件設定
GoDaddy SMTP
main.cf:
### for GodaddyGoDaddy SMTP with Office 365
relayhost = [smtp.office365.com]:587
# SASL
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd_godaddy
smtp_sasl_type#smtp_sasl_type = cyrus
#smtp_sasl_mechanishm_filter=digest-md5
#smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
# TLS
smtpd_tls_key_file = /etc/postfix/tls/godaddy.key
smtpd_tls_cert_file = /etc/postfix/tls/godaddy.crt
smtpd_use_tls = yes
smtp_use_tls = yes
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 2
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_randome_source = dev:/dev/urandom
# Fix for MAIL-FROM
smtp_generic_maps = hash:/etc/postfix/generic
建立密碼檔 saslpasswd_godaddy,內容格式如下:
smtp.office365.com your@domain.name:thisispass
chmod 0600 saslpasswd_godaddy
postmap hash:/etc/postfix/saslpasswd_godaddy
建立憑證檔
cd /etc/postfix
mkdir tls
cd tls
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout godaddy.key -out godaddy.crt