
我有一個 Digital Ocean VPS,我在其中安裝了後綴。我想要做郵件轉寄。
當我安裝 postfix 時我選擇了無配置選項。後來我設定了以下內容:
我創建main.cf
在/etc/postfix
virtual_alias_domains = gintegraconstruccion.com
virtual_alias_maps = hash:/etc/postfix/virtual
已創建virtual
然後我重新啟動了postfix。
在我的 DNS 配置中(我得到去吧爸爸)我做了:
創建了一個一個記錄:
Host Points to
contacto 107.XX.XX.XX
創建了一個MX記錄:
Host Points to
@ contacto.gintegraconstruccion.com
不過我嘗試了一下,並在我的 gmail 收件匣中收到了任何郵件。
的輸出dig gintegraconstruccion.com
是:
; <<>> DiG 9.8.1-P1 <<>> gintegraconstruccion.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34297
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;gintegraconstruccion.com. IN MX
;; ANSWER SECTION:
gintegraconstruccion.com. 599 IN MX 0 contacto.gintegraconstruccion.com.
;; Query time: 93 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Wed May 14 13:01:53 2014
;; MSG SIZE rcvd: 67
鄭重聲明一下,我目前正在使用 Openshift 託管網站,因為我尚未遷移它。
檢查於/etc/log/mail.log
我發現:
May 14 11:52:51 localhost postfix/postfix-script[24478]: fatal: the Postfix mail system is not running
May 14 12:02:05 localhost postfix/postfix-script[24600]: fatal: the Postfix mail system is not running
May 14 12:02:27 localhost postfix/master[24724]: daemon started -- version 2.9.6, configuration /etc/postfix
May 14 12:02:31 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix
May 14 13:06:07 localhost postfix/smtpd[24865]: error: open database /etc/aliases.db: No such file or directory
May 14 13:06:07 localhost postfix/smtpd[24865]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
May 14 13:06:07 localhost postfix/smtpd[24865]: connect from f.qw.se[109.74.194.71]
May 14 13:06:13 localhost postfix/smtpd[24865]: disconnect from f.qw.se[109.74.194.71]
May 14 13:06:44 localhost postfix/smtpd[24865]: connect from f.qw.se[109.74.194.71]
May 14 13:07:07 localhost postfix/smtpd[24865]: 5F052432EF: client=f.qw.se[109.74.194.71]
May 14 13:07:15 localhost postfix/smtpd[24865]: disconnect from f.qw.se[109.74.194.71]
May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max connection rate 2/60s for (smtp:109.74.194.71) at May 14 13:06:44
May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max connection count 1 for (smtp:109.74.194.71) at May 14 13:06:07
May 14 13:10:36 localhost postfix/anvil[24867]: statistics: max cache size 1 at May 14 13:06:07
May 14 13:14:20 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix
May 14 13:18:29 localhost postfix/master[24724]: reload -- version 2.9.6, configuration /etc/postfix
May 14 13:21:04 localhost postfix/smtpd[24982]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
May 14 13:21:04 localhost postfix/smtpd[24982]: connect from mail-wi0-f175.google.com[209.85.212.175]
May 14 13:21:05 localhost postfix/smtpd[24982]: 1BC40432EF: client=mail-wi0-f175.google.com[209.85.212.175]
May 14 13:21:05 localhost postfix/cleanup[24987]: 1BC40432EF: message-id=<[email protected]$
May 14 13:21:05 localhost postfix/qmgr[24976]: 1BC40432EF: from=<[email protected]>, size=2670, nrcpt=1 (queue active)
May 14 13:21:05 localhost postfix/smtpd[24982]: disconnect from mail-wi0-f175.google.com[209.85.212.175]
May 14 13:21:05 localhost postfix/smtp[24988]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c01::1a]:25: Network is unreachable
May 14 13:21:06 localhost postfix/smtp[24988]: 1BC40432EF: to=<[email protected]>, orig_to=<[email protected]$
May 14 13:21:06 localhost postfix/qmgr[24976]: 1BC40432EF: removed
日誌的最後幾行(從 hotmail 發送郵件後工作):
May 14 13:52:19 localhost postfix/smtpd[25133]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
May 14 13:52:19 localhost postfix/smtpd[25133]: connect from col0-omc1-s18.col0.hotmail.com[65.55.34.28]
May 14 13:52:20 localhost postfix/smtpd[25133]: 22ED0432EF: client=col0-omc1-s18.col0.hotmail.com[65.55.34.28]
May 14 13:52:20 localhost postfix/cleanup[25137]: 22ED0432EF: message-id=<[email protected]>
May 14 13:52:20 localhost postfix/qmgr[25091]: 22ED0432EF: from=<[email protected]>, size=1528, nrcpt=1 (queue active)
May 14 13:52:20 localhost postfix/smtpd[25133]: disconnect from col0-omc1-s18.col0.hotmail.com[65.55.34.28]
May 14 13:52:22 localhost postfix/smtp[25138]: 22ED0432EF: to=<[email protected]>, orig_to=<[email protected]>$
May 14 13:52:22 localhost postfix/qmgr[25091]: 22ED0432EF: removed
答案1
因為您的虛擬地圖是建立檔案後的類型(由配置行中hash
的 指定),所以您需要透過執行來建立地圖。hash:
virtual
postmap /etc/postfix/virtual
從日誌中的錯誤來看,您還需要運行,postalias /etc/aliases
因為它抱怨沒有aliases.db
文件。
virtual_alias_domains
您的配置行中有一個拼字錯誤。域的第一個字母是 Q 而不是 G。
virtual_alias_domains = qintegraconstruccion.com
如果它存在於您的實際設定檔中並且不僅僅是這裡問題中的拼字錯誤,那麼它也需要修復。
最後,您提供的日誌樣本中似乎有一封成功轉發的電子郵件。訊息1BC40432EF
已成功傳送至 Google。谷歌很可能在接受電子郵件後就將其丟棄,但他們做過接受。
一般交付能力對你來說很重要。由於您沒有執行 Google Apps for Business,因此您無法從 Google 內部將您的 IP 位址列入白名單。因此,您必須遵守所有正常的最佳實踐。如果一切正確,Gmail 就不會拒絕您的郵件。
- 您目前無法對您的 IP 位址進行反向查找。您必須向 DigitalOcean 詢問此事。它應該與
myhostname
您的 postfix 配置中的指令相同。我建議使用,contacto.gintegraconstruccion.com
因為它已經指向正確的 IP 位址。 - 您目前不在 SpamHaus 的 PBL 中。這很好,但很幸運。亞馬遜 EC2 地址是除非您要求亞馬遜刪除您的 PBL。雲端提供者(和住宅提供者)很可能位於 PBL 中,因為他們的政策是您不應從該 IP 位址發送郵件。
- 你沒有SPF記錄。
- 您不太可能有 DKIM 記錄。
- 您沒有 DMARC 記錄。這將有助於理解為什麼一些提供者拒絕您的郵件。如果您錯誤地設定了 SPF 或 DKIM 記錄,DMARC 報告將會通知您。
- From: 地址是@gmail.com 地址。我不知道您的信封寄件者地址是什麼樣子,但如果也是這樣,那麼
gmail.com
任何支援 SPF 的主機都會拒絕您的郵件,因為您的 IP 位址不在 Gmail 的 SPF 記錄中。信封寄件者地址由smtp_helo_name
您的 postfix 配置中的行設定。