系統環境:
編輯 /etc/mail/sendmail.mc
cd /etc/mail cp -a sendmail.mc sendmail.mc.orig vi sendmail.mc
搜尋 SMART_HOST
define(`SMART_HOST', `your.smtp.server')dnl
搜尋 masquerade_envelope
FEATURE(masquerade_envelope)dnl FEATURE(genericstable, `hash -o /etc/mail/genericstable') GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl
搜尋 authinfo,若沒有,就新增這幾行,但必須在 MAILER 項目的上方:
dnl # dnl # This is for SMTP mail server relay FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
新增 domain 設定
cd /etc/mail hostname -f > genericsdomain touch genericstable makemap -r hash genericstable.db < genericstable
NOTES:
執行 hostname -f 出現錯誤 Unknow host
請檢查 /etc/hosts 有無紀錄
新增 SMTP 認證帳號及密碼的設定
cd /etc/mail mkdir auth chmod 700 auth/ cd auth/ vi client-info
AuthInfo:your.smtp.server "U:smmsp" "I:userid" "P:password"
NOTES:
your.smtp.server SMTP 主機位址
userid SMTP 帳號
password SMTP密碼
chmod 0600 client-info makemap -r hash client-info.db < client-info service sendmail restart
//