Set up Reply via Email Support ✉

(Robert) #43

Have you considered to use the Discourse API instead?

Simple plugin that offers an HTTP POST endpoint to mailgun or any other mail service
Simple plugin that offers an HTTP POST endpoint to mailgun or any other mail service
(Daniel) #44

Just setting this up for our forum using a Google Apps email address and at the pop3s_polling_enabled stage got this:

POP3 authentication failed. Please verify your pop3 credentials.

Google had sent an email to the mailbox on the failure:

attempt prevented
Someone just tried to sign in to your Google Account from an app that doesn’t meet modern security standards.
Friday, February 19, 2016 7:51 AM (GMT)
We strongly recommend that you use a secure app, like Gmail, to access your account. All apps made by Google meet these security standards. Using a less secure app, on the other hand, could leave your account vulnerable. Learn more.

Google stopped this sign-in attempt, but you should review your recently used devices:

The Google Accounts team

On the learn more page, there is a link to a page where you can enable access for less secure apps.

EDIT: I’ve just noticed “less secure apps” has been mentioned already in this thread. Perhaps we could add it to the howto?

(Erlend Sogge Heggen) #45

For now I just added a note linking to your post. I haven’t run into this myself so I’m not quite sure how to write it up. Feel free to suggest a full paragraph for me to add in there.

(I could make the topic wiki-fied but account-sensitive tutorials like this one could be prone to abuse. Very low chance of that with our TL barrier but better safe than sorry.)

(Daniel) #46

If you are using a Google Apps mailbox (e.g. a Google mailbox not, you will need to enable “access from less secure apps” in Google Account settings. If not, you will receive a “POP3 authentication failed” error in Discourse. Access from “less secure apps” is disabled by default for Google Apps customers.

(Tobias Eigen) #47

I think you can future proof this #howto topic by adding “check the mailbox for errors”. The email from Google explains exactly what is needed in this case.

(Dean Taylor) #48

I posted this elsewhere, but thought this might be useful to others here / perhaps edited into the original post.

If you end up with a setup like this after using Gmail for you incoming mailbox …

You can clean up your branding here and stop the user from seeing emails from even when you don’t have mail alias support ( with your mail server:

  1. Setup a subdomain
  2. Add additional domain to outgoing mail provider.
  3. Add “TXT” DNS records for SPF / DKIM to provided by your outgoing mail provider.
  4. Setup a mail forwarder to forward * to
  5. Change reply to replies+%{reply_key}

Reply to email - key in subject instead of email address?
Using subject line for reply-by-email identifier
(Tom Newsom) #49

I forwarded your advice to our email guy and he said it wouldn’t work because we already use Google Apps to provide our email addresses (and at $6/month we’re not particularly keen on taking on more of them). Is he right?

(Dean Taylor) #50

In this case the sub-domain can use a completely different provider and setup when compared to the domain
So you “could” use any standard hosting just for MX mail exchange (receipt) on just that sub-domain.

If you are actually paying for “Google Apps for Work” (not the legacy free edition of Google Apps) you can configure mail to forward (to the free Gmail account) for free.

You don’t even need a sub-domain so instead of:
you could go with:

  1. Login as a domain admin
  2. Select “Apps” >“Google Apps” > “Gmail”
  3. Select “Advanced settings >” (near the bottom)
  4. Select “Default routing” at the top
  5. Select “Add Setting”
  6. Setup the setting as follows:

    That regular expression is ^replies\+[^@]+@
    If you have multiple domains in your Google Apps for Work account you might want to include the domain qualifier on the end of that expression (remember to escape you periods \.)
  7. Save

That will then forward that mail elsewhere for free without requiring payment for an additional Google Apps for Work user.

Using subject line for reply-by-email identifier
(Glynhudson) #51

Anyone got this to work using FastMail? I’m attempting to use two separate fast mail accounts one for outgoing and the other for incoming. Outgoing was working fine until I enabled incoming. Once incoming was enabled my site has stopped sending any outgoing emails. I can see in the logs every time I send an email to my incoming address the error:

Email can not be processed: Email::Receiver::BadDestinationAddress Return-Path

This is however proof that discouse is managing to retrieved email from my incoming POP account.

My settings are as follows:

(Sam Saffron) #52

We are working on setting up incoming email automatically for all our customers, even starting some work on it in the upcoming week.

Perhaps @zogstrip can look at trialing some of the setup on your instance.

Regarding the bad return path, we automatically generate a return path, I wonder if fast mail is somehow disallowing + addressing in return path (which we need to detect bounces) I am open to adding another site setting to bypass the return path stuff if we must.

(Glynhudson) #53

Thanks so much for following this up. I’m not sure what the issue was but
I’ve managed to get it working. I think part of the issue was I was
struggling to test since I hadn’t realised that since my user was active I
was not receiving mail! I have not seen any more errors like this and it’s
working great now :wink:

  • sent from my mobile device

(François Eric King) #54

I create a new GMail account.
I turn it on via Settings, Forwarding and POP/IMAP. 2-Step Verification is off.
Settings in discourse:

reply_by_email_address replies.sensorica+%{reply_key}
pop3_polling_password pa$$word
pop3_polling_host set to
pop3_polling_port set to 995
pop3_polling_enabled set to true
reply_by_email_enabled set to true
manual_polling_enabled set to false
pop3_polling_ssl set to false
log_mail_processing_failures set to true
email_in set to true

i see in the footer of all notification mails now tell me that i can reply either by visiting the website, or replying via email:
To respond, reply to this email or visit {topic URL} in your browser.

But after respond by reply in gmail, nothing is posted.

I get a Mail Delivery Subsystem

i check the /logs path on my Discourse in my web browser and i look for email related error messages but nothing.

I log into my mail account using my web browser and check for any errors or notifications but nothing there too exept Mail Delivery Subsystem .

Gmail and server are at same country.
Maybe its about gmail aliasing too

Any clue?


(Régis Hanol) #55

Are you sure the reply_by_email_address is set to replies.sensorica+%{reply_key}

Because from the error logs, it looks like it’s missing the + sign. (email was sent to

(Atul Sharma) #57

I am using hostgator hosting, i checked setting,
I have to enable outgoing authentication require enabled in outlook
so how to do in discourse installation,

(Pad Pors) #58

this is the fourth time i’m trying to set up reply via email. and still i haven’t figured out what’s missing. here is what i set:

I just used something similar to other posts in this topic, then the email notifications i get for a sample is something like this:

as one can note, the email address in the header is still and not

and i got errors like this:

which tells me something is wrong :frowning:

can anyone please help me understand what’s going on?

(Régis Hanol) #59

Make sure you enable “access from less secure apps”.

(Pad Pors) #61

thanks @zogstrip , and yes that was the solution. :slight_smile:

may that “not” be deleted from the main topic so that less people ignore that line?

(Jeff Wong) #62

I have periodically gotten that error. Access for less secure apps is turned on.

(this stacktrace looks familiar)
Message (14 copies reported)

Job exception: -ERR [SYS/TEMP] Temporary system problem. Please try again later.

/usr/local/lib/ruby/2.3.0/net/pop.rb:1006:in `check_response_auth'
/usr/local/lib/ruby/2.3.0/net/pop.rb:905:in `auth'
/usr/local/lib/ruby/2.3.0/net/pop.rb:567:in `do_start'
/usr/local/lib/ruby/2.3.0/net/pop.rb:531:in `start'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:34:in `poll_pop3'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:16:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

It’s a throwaway email that’s setup just for discourse, so I don’t sign into it manually. I suspect the following causes:
login required captcha - about 2 months ago… this one was my own fault; I had a pretty insecure throwaway password (it was totally hunter2, guys). Updated to stronger auto generated one.
ToS agreement update - Errors started showing in the logs again last night. Upon logging in manually, Gmail updated an agreement, which I had to agree to before I could access the inbox. I can only assume this would be the root cause from the errors from last night.

I’ll check to see if this solves the errors, but I thought to post back here that this might be suspect, in case other self-hosted sites are seeing this issue.

(Camille Roux) #63

Is it possible to use Migadu for this? Did someone test it?

(Jim Brandt) #67

Adding some detail from my experience since Googling the error message “Email can not be processed: Email::Receiver::BadDestinationAddress Return-Path” finds this post.

In our case we also got all of the pop settings configured, but it seems there are two other places email can be set. There’s a main contact email on the Required tab that we had set to a different address, so we updated there. Each category also can have its own email address and you can set that in the category configuration. I think that’s the setting that was required to tell Discourse where to route new topic email (email that is not a reply to an existing post).