メール転送の場合、Postfix の MX レコードはどのように設定すればよいですか?

メール転送の場合、Postfix の MX レコードはどのように設定すればよいですか?

私は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。ドメインの最初の文字が G ではなく Q です。

virtual_alias_domains = qintegraconstruccion.com

それが実際の設定ファイルに存在し、ここでの質問のタイプミスだけではない場合は、修正も必要です。

最後に、あなたが提供したログサンプルには、転送に成功したメールが1件あるようです。メッセージは1BC40432EFGoogleに正常に送信されました。Googleはメールを受け取った後に破棄した可能性がありますが、した受け入れ。


一般的な配送可能性は重要です。Google Apps for Business を実行していないため、Google 内から IP アドレスをホワイトリストに登録する方法はありません。したがって、通常のベスト プラクティスをすべて遵守する必要があります。すべて正しく実行すれば、Gmail はメールを拒否しないはずです。

  • 現在、IP アドレスの逆引き検索がありません。DigitalOcean に問い合わせる必要があります。これは、postfix 構成のディレクティブと同じである必要がありますmyhostname。すでに正しい IP アドレスを指しているので、使用することをお勧めしますcontacto.gintegraconstruccion.com
  • 現在、SpamHaus の PBL には参加していません。これは良いことですが、ラッキーです。Amazon EC2 アドレスAmazon に削除を依頼しない限り、PBL には登録されません。クラウド プロバイダー (および住宅プロバイダー) は、その IP アドレスからメールを送信してはならないというポリシーがあるため、PBL に登録されている可能性があります。
  • あなたはSPFレコード
  • DKIM レコードを持っている可能性は低いです。
  • DMARC レコードがありません。これは、一部のプロバイダーがメールを拒否している理由を理解するのに役立ちます。SPF または DKIM レコードを誤って設定している場合は、DMARC レポートで通知されます。
  • From: アドレスは @gmail.com アドレスです。あなたのエンベロープ送信元アドレスがどのようなものかはわかりませんが、もしそうなら、gmail.comIP アドレスが Gmail の SPF レコードにないため、SPF をサポートするホストはあなたのメールを拒否します。エンベロープ送信元アドレスは、smtp_helo_namePostfix 構成の行によって設定されます。

関連情報