[問題] mail hinet 寄信被阻擋

作者: aaa7513231 (渾沌與秩序)   2015-12-21 11:00:47
大家好 由於專案需求我必須針對使用者做寄信通知
程式碼如下
def SendMail(strRecipient,strSubject,strContent):
s = smtplib.SMTP('mail.XXX.com.tw')
s.set_debuglevel(1)
msg = MIMEMultipart('alternative')
msg.attach(MIMEText(strContent, 'plain'))
sender = 'notice@ekc.com.tw'
msg['Subject'] = strSubject
msg['From'] = sender
msg['To'] = strRecipient
try:
try:
s.sendmail(sender, strRecipient, msg.as_string())
finally:
s.quit()
except smtplib.SMTPRecipientsRefused, e:
print >> DEBUGSTREAM, 'got SMTPRecipientsRefused'
refused = e.recipients
我寄其他人的如gmail信箱是正常寄信
但是遇到hinet.net的信箱則遇到了問題
Relaying denied. Proper authentication required
我系統使用centos 6.4
python 2.7
相信是某個設定有問題
但很抱歉我搜尋很久依然找不出問題來
希望大家能幫忙我找出問題
謝謝大家:)
作者: kenduest (小州)   2015-12-21 11:40:00
你要確認 mail.XXX.com.tw 那台機器本身有允許讓你主機所在的 ip 有開放 mail relay 功能
作者: aaa7513231 (渾沌與秩序)   2015-12-22 12:57:00
謝謝K大!!,確實是伺服器設定上的問題:)

Links booklink

Contact Us: admin [ a t ] ucptt.com