系統環境:
// 安裝 ssmtp 套件
// 套件庫:http://wiki.centos.org/AdditionalRes...t=Repositories
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -ivh epel-release-5-4.noarch.rpm
yum install ssmtp vi /etc/ssmtp/ssmtp.conf
# Get enhanced (*really* enhanced) debugging information in the logs # If you want to have debugging of the config file parsing, move this option # to the top of the config file and uncomment #Debug=YES # For SMTP relay with gmail server #root=postmaster #AuthUser=myname@gmail.com #AuthPass=password #FromLineOverride=YES #mailhub=smtp.gmail.com:587 #UseSTARTTLS=YES # For SMTP server MailHub=your.smtp.server:5525 # SMTP server hostname and port #UseTLS=YES # Secure connection (SSL/TLS) FromLineOverride=YES # Force the From: line Hostname=pbx.my.domain # The name of this host RewriteDomain=my.domain # The host the mail appears to be coming from Root=postmaster # Redirect mail for root@ to postmaster@ AuthUser=user@your.smtp.server # Your SMTP server mail account AuthPass=password # Your SMTP server mail password AuthMethod=CRAM-MD5
以下設定適用 Hinet 的發信主機
MailHub=msr.hinet.net:25 FromLineOverride=NO Hostname=msa.hinet.net root=<username> AuthUser=<username>> AuthPass=<password> AuthMethod=LOGIN
// 關閉 sendmail 並且以 ssmtp 取代
service sendmail stop chkconfig sendmail off cd /usr/sbin mv sendmail sendmail.orig ln -s /usr/sbin/ssmtp /usr/sbin/sendmail
// 寄信測試
mail -s "this is a test mail" your@yahoo.com.tw 輸入 . <Enter> Cc: <Enter>
Ans: 修改 /etc/asterisk/vm_general.inc
serveremail=vm@your.domain.name
Ans: 修改 /etc/ssmtp/ssmtp.conf
FromLineOverride=NO root=win.mis03
修改 /etc/ssmtp/revaliases
root:win.mis03@msa.hinet.net
TIPs:
以上僅適合用 root 帳號發信時,如果是 www-data 帳號,就將設定裡的 root 改成 www-data
Images 0 | ||
---|---|---|
No images to display in the gallery. |