1

Is it possible to build a custom SMTP server on Google App Engine to listen for incoming email, using the Python smtpd module?

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
blob
  • 439
  • 8
  • 21

1 Answers1

1

App Engine's hosted and custom runtimes are meant for HTTP traffic (ports 80 and 443). You will not be able to receive traffic on the ports necessary to operate an SMTP server.

In fact, ports 25, 465 and 587 are blocked for outbound connections across all of Google Cloud. Instead, you can use an external service such as SendGrid, Mailgun, or Mailjet: https://cloud.google.com/compute/docs/tutorials/sending-mail#choosing_an_email_service_to_use

(This article is about sending email but these services allow you to receive email as well.)

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
  • The documentation is for sending email, I need to receive email, I want an event that is triggered everytime I receive an email. – blob May 28 '20 at 06:22
  • All of these services support receiving email as well: https://sendgrid.com/docs/API_Reference/Parse_Webhook/inbound_email.html, https://documentation.mailgun.com/en/latest/quickstart-receiving.html – Dustin Ingram May 28 '20 at 18:00