Skip to main content

外寄郵件設定

GoDaddy SMTP

main.cf:

## for GoDaddy 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 = cyrus
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

指定 MAIL-FROM 位址

編輯 /etc/postfix/generic

root@freepbx.sangoma.local your@sender.email.address
root your@sender.email.address
asterisk your@sender.email.address

轉換 generic

cd /etc/postfix
postmap generic