2016-08-18 1 views
1

저는 서버에서 이메일을 보내는 데 매우 익숙하며, 내 VM에서 이메일을 설정하려고하므로 crontab 이메일을 보낼 수 있습니다 (이상 일부 python 스크립트에서는 임의 알림 유형 전자 메일을 보내야합니다.) 내 Amazon Linux EC2 상자에서는이 모든 것이 방망이 바로 작동했지만 GCCE Ubuntu 16.04 인스턴스에 문제가 있습니다.Google Apps를 통해 Google Cloud Compute Engine Ubuntu VM에서 이메일이 작동하지 않습니다.

Compute Engine 인스턴스에서 Google always blocks port 25을 알고 있지만 그 중 일부는 documentation인데도 Google Apps를 통해 SMTP 릴레이를 사용하여 이메일을 보낼 수 있음을 알 수 있습니다. 나는 특히 SendGrid와 같은 타사 서비스를 사용하고 싶지 않으므로 이것이 내 최선책 (유일한 것) 옵션처럼 보입니다. 그러나이 문서는 GCCE를 위해 작성된 것 같지 않습니다.

현재 상태 : 내가 그것을 몇 가지 research을 수행하여 몇 시간 동안 작동시킬 수 있었고, 성공적으로 내 crontab을 작업에서 이메일을 수신했다. 그러나, 내가 가진 다음 날 아침 인스턴스를 다시 시작 없습니다 그 이후 (다른 변경 사항은) 내 mail.log은 바로이 오류로 가득하지, 난 더 이상 수신 이메일입니다 :

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) 

내 접미사 설정 파일 내 'myorigin'파일에 내 도메인 이름이 포함되어 있으며 미리 SMTP 릴레이에 구성했습니다. Google 도메인 용 Google Apps의 Gmail 설정 (지정된 IP 주소 (내 VM 외부 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 

이 특정 문제를 해결하려면 어떻게해야합니까? 감사!

답변

1

Google에서 설명하는 설정을 사용하여 작동시키는 방법을 알지 못했지만 here 단계를 거친 다른 임의의 Gmail 주소를 통해 간단한 SMTP 릴레이를 설정할 수있었습니다.

관련 문제