解決Postfix被gmail退信問題

原贴:http://www.andowson.com/posts/list/98.page

andowson
<script type="text/javascript">writeStars(0, "2166");</script> *****
初段學員
[Avatar]

註冊時間: 2007-01-02 22:20:40
文章: 160
來自: 台北
離線

<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> width="300" scrolling="no" height="250" frameborder="0" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-9570897300865282&dt=1194450249442&lmt=1194450246&prev_fmts=728x15_0ads_al_s%2C728x90_as&format=300x250_as&output=html&correlator=1194450249442&channel=8848213845&url=http%3A%2F%2Fwww.andowson.com%2Fposts%2Flist%2F98.page&ad_type=text_image&ref=http%3A%2F%2Fwww.google.cn%2Fsearch%3Fcomplete%3D1%26hl%3Dzh-CN%26q%3Dpostfix%2Bgmail%26btnG%3DGoogle%2B%25E6%2590%259C%25E7%25B4%25A2%26meta%3D%26aq%3Dt%26oq%3Dpostfix%2Bgm&ui=rc%3A6&cc=71&ga_vid=762559445.1194450247&ga_sid=1194450247&ga_hid=518207412&flash=9&u_h=800&u_w=1280&u_ah=772&u_aw=1280&u_cd=24&u_tz=480&u_his=1&u_nplug=3&u_nmime=4" name="google_ads_frame">
最近發現從主機每天自動備份完成的通知信被gmail退了,錯誤訊息大致如下:
host gmail-smtp-in.l.google.com[209.85.147.27] said:
550-5.7.1 [220.135.57.87] The IP you're using to send email is not
authorized 550-5.7.1 to send email directly to our servers. Please use
550 5.7.1 the SMTP relay at your service provider instead. j21si8542316wah
(in reply to end of DATA command)

由於之前postfix都還運作得好好的,故很難想出問題出在那裡,在Google找了一陣子,終於找到了一篇轉換到 Google Apps, localhost 信寄不出去的解法,裡面提到修改/etc/postfix/mail.cf,把postfix預設的順序調整一下,例如原來我的設定是:
  1. mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,  
  2.         mail.$mydomain, www.$mydomain  

將它調整為localhost排最前面即可:
  1. mydestination = localhost, localhost.$mydomain, $myhostname, $mydomain,  
  2.         mail.$mydomain, www.$mydomain  

設定完成之後用
postfix check
指令檢查一下
然後重新啟動
service postfix restart
再發信測試看看,哈!gmail可以收到信了!

參考資料:
Tsung's Blog: 轉換到 Google Apps, localhost 信寄不出去的解法
鳥哥的 Linux 與 ADSL 私房菜: 簡易 Mail Server 架設 -- Postfix 設定

這篇文章被編輯了 8 次. 最近一次更新是在 2007-07-07 11:38:29


分享經驗 累積智慧
[WWW] [MSN] del.icio.us HEMiDEMi 收進你的MyShare個人書籤 儲存至Yahoo!「分享書籤」 新增到udn共享書籤 添加到百度搜藏
utopian
<script type="text/javascript">writeStars(0, "176226");</script> *****
十級學員
[Avatar]

註冊時間: 2007-08-28 09:35:34
文章: 2
離線

这是什么原理?

乌托邦博客
http://www.bootad.cn
[WWW] [MSN] del.icio.us HEMiDEMi 收進你的MyShare個人書籤 儲存至Yahoo!「分享書籤」 新增到udn共享書籤 添加到百度搜藏
andowson
<script type="text/javascript">writeStars(0, "2227");</script> *****
初段學員
[Avatar]

註冊時間: 2007-01-02 22:20:40
文章: 160
來自: 台北
離線

$ dig mx andowson.com

; <<>> DiG 9.2.4 <<>> mx andowson.com
;; global options: printcmd
;; Got answer:
;; ->&gtHEADER<&lt- opcode: QUERY, status: NOERROR, id: 24079
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;andowson.com. IN MX

;; ANSWER SECTION:
andowson.com. 604800 IN MX 10 aspmx.l.google.com.
andowson.com. 604800 IN MX 20 alt1.aspmx.l.google.com.
andowson.com. 604800 IN MX 30 alt2.aspmx.l.google.com.
andowson.com. 604800 IN MX 40 aspmx2.googlemail.com.
andowson.com. 604800 IN MX 50 aspmx3.googlemail.com.
andowson.com. 3600 IN MX 60 220-135-57-87.hinet-ip.hinet.net.
andowson.com. 3600 IN MX 100 smtp.where.secureserver.net.
andowson.com. 3600 IN MX 200 mailstore1.secureserver.net.

;; AUTHORITY SECTION:
andowson.com. 3600 IN NS park29.secureserver.net.
andowson.com. 3600 IN NS park30.secureserver.net.

;; Query time: 558 msec
;; SERVER: 168.95.1.1#53(168.95.1.1)
;; WHEN: Wed Aug 29 08:01:55 2007
;; MSG SIZE rcvd: 317

申請了Google Apps的 郵件代管後, 在DNS上面設定MX順序時已把gmail放在上面了, 等於是Postfix對 andowson.com 的 MX 指到 gmail去了,因此信就往 gmail smtp跑, 而gmail smtp沒開放 open relay, 當然就寄不出去囉.

這篇文章被編輯了 1 次. 最近一次更新是在 2007-08-29 08:08:50


 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值