Code for receiving emails via Discourse API

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:

https://github.com/discourse/discourse/blob/master/app/controllers/admin/email_controller.rb#L124

4 Likes
6 Likes

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.

1 Like