Code for receiving emails via Discourse API

סיכום מבוסס בינה מלאכותית

The discussion revolves around using the Discourse API to receive emails. sudoman is looking for a preexisting code base to push emails to Discourse’s incoming email API. blake provided a starting point by mentioning the admin/email/handle_mail endpoint and sharing the corresponding controller method from the Discourse repository.

jshockley is seeking more comprehensive documentation to help their technical team set up inbound email via the API. They currently use POP3 polling with a workaround and want to switch to the Google Cloud Platform Email API for larger scale deployment. jshockley also shared their current setup and the limitations they are facing. mpalmer provided a link to a related topic on the Discourse Meta forum, which might be helpful in finding a solution.

Hello Discourse,

Is there a preexisting code base out there for pushing emails to Discourse’s incoming email API?

Thanks,
Andrew

From the output of rake routes You can send a POST request to

admin/email/handle_mail

Here is the controller method from handle_mail:

For a non-technical user I’d need to understand the capabilities of inbound email via API:

What I’ve done already:

  • Inbound Emails via POP3 polling to main domain (not subdomain)
  • Working inbound email via the postfix mail module but that only works for subdomain - in my case, xxx@community.eleoptics.com - which we can not use, need primary domain.

Current Setup:

  • Inbound email: G Suite Google “Groups” email address forwarding to free Gmail accounts (to avoid paying for a Gsuite account per email address). POP3 polling
  • Outbound email: SMTP Relay Forwarding via GSuite validated by the IP of my Discourse server install on Google Cloud.

This works but the free Gmail pop3 polling accounts is something I’d like to get away from.

We plan to use the Google Cloud Platform Email API to handle email in-out ideally for larger scale deployment and service.

Where is the documentation I could send my tech employees on how to get inbound email going directly to discourse?

If that is already linked in the post above then thank you. Otherwise my guess is there needs to be a greater contextualized explanation.