私は非常に新しいメールをサーバーから送信し、自分のVMでメールを設定しようとしているので、crontabメールを送信することができますいくつかのPythonスクリプトでは、ランダム通知タイプの電子メールを送信する必要があります)。私のAmazon Linux EC2のボックスでは、これはすべてバットからすぐに働いていましたが、私はGCCE Ubuntu 16.04インスタンスで問題が発生しています。Google Cloud Compute Engineからメールが届かない
Compute EngineのインスタンスでGoogle always blocks port 25を知っていますが、彼らはまた、documentationを指していますが、私はまだGoogle Apps経由のSMTPリレーを使用してメールを送信できます。私は特にSendGridのようなサードパーティのサービスを使いたくないので、これは私の最高の(唯一の)オプションのようです。しかし、そのドキュメンテーション^は特にGCCEのために書かれたようではありません。
CURRENT STATUS: は、私はそれはいくつかのresearchをすることによって、数時間のために働くことを得ることができた、そして成功した私のcrontabのジョブからのメールを受信でした。
Aug 18 17:17:56 my-master-compute-engine2 postfix/error[18060]: A7812BCE13: to=<[email protected]>, relay=none, delay=50875, delays=50874/0.13/0/0, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with smtp-relay.gmail.com[173.194.74.28] while performing the HELO handshake)
私のpostfixの設定ファイル:しかし、次の日の朝、私は私にmail.logはちょうどこのエラーで満たされていない、と私はもはや電子メールを受け付けておりますインスタンスとそれ以降(他の変化点)を再起動する必要がありましたmy 'myorigin'ファイルには自分のドメイン名だけが含まれていますが、これをSMTP中継で事前に設定しておきます。Google Apps for my domainのGmail設定(特定のIPアドレスからのメールのみ許可 - そして、SMTP認証やTLS暗号化)を必要としないのです。私は、この特定の問題を解決する、あるいは周りの仕事を見つけることができますどのように
# Google Apps Relay SMTP, must use Port 587 because, 25 is blocked
relayhost = [smtp-relay.gmail.com]:587
# a file which should contain the google apps domain
myorigin = /etc/mailname
# Force ehlo behavior
smtp_always_send_ehlo = yes
smtp_helo_name = my.vm.external.ip # vm external ip (same that is configured in smtp relay in google apps)
myorigin = /etc/mailname
mydestination = $myhostname, my-master-compute-engine2.c.random-stuff.internal, localhost.c.random-stuff.internal, , localhost
mynetworks = 127.0.0.0/8 my.internal.ip.address/32 [::1]/128 [fe80::]/64
mailbox_size_limit = 0
recipient_delimiter = +
# limit smtp to loopback interface & compute engine doesn't support ipv6
inet_interfaces = loopback-only
inet_protocols = ipv4
?ありがとう!