POP3 polling stopped working

Hi all, I had been using the email-in and reply-by-email features and they were working well for a few months until they suddenly stopped working.

I suspected that the polling period was too frequent and google may have blocked my install.
I reset the email settings, created a new google apps email and double checked the “allow less-secure apps settings” etc but to no avail.

My problem is now that when I re-click pop3 polling enabled it gives an error “POP3 authentication failed. Please verify your pop3 credentials.” even though the credentials are correct and SSL is enabled.

Any ideas on what may be the problem? I tested pop3 polling from my laptop(not the discourse server yet) and it accepted the polling without any problem which makes me suspect that the settings I place in the admin settings section are not being applied properly. Any support would be much appreciated.

Here’s how I would debug it: SSH into your server and then

cd /var/discourse
./launcher enter app
rails c
require "net/pop"
pop3 = Net::POP3.new("pop.gmail.com", 995)
pop3.auth_only("username", "password")

And check what error you get from the last line.

root@localhost-app:/# rails c
You are running an old version of bundler, please upgrade bundler ASAP, if you are using Discourse docker, rebuild your container.
[1] pry(main)> require "net/pop"
=> false
[2] pry(main)> require "net/pop"
=> false
[3] pry(main)> pop3 = Net::POP3.new("pop.gmail.com", 995)
=> #<Net::POP3 pop.gmail.com:995 open=false>
[4] pry(main)> pop3.enable_ssl
=> 995
[5] pry(main)> pop3.auth_only("replies@southsudanngoforum.org", "*******")

Net::POPAuthenticationError: -ERR [AUTH] Username and password not accepted.
from /usr/local/lib/ruby/2.0.0/net/pop.rb:1005:in `check_response_auth'
[6] pry(main)> 

In the admin settings page all POP3 related boxes are selected except pop3 polling enabled as it gives an error.

Could the problem be associated with the old version of bundler mentioned. Should I run ./launcher rebuild app?

1 Like

The bundle issue is not related. The error is coming from the username/password. Can you log in with these on the webmail? Make sure that Google hasn’t blocked a connection coming from another location (ie. where your server is hosted).

Login to webmail using these credentials works fine.
It may be possible that for some reason google has begun blocked polling from my discourse server’s IP address.
Is there a way to get google to remove this block? Allow less secure apps is already selected as are the unblocking steps shown in other threads here.

I’m not sure. Did you enable 2-step authentication by any chances? Or application-specific password?

@brianmcdonald, I realize you may not have the same setup, but I too had a situation when the setup looks good, but on re-click “pop3 polling enabled” it gives the “POP3 authentication failed” error.

I have a https only site setup with Google Authentication working on a different machine a few days ago. Today, on a different server with same setup, something seems to have changed on the Google side. When I re-click “pop3 polling enabled” it gives the error "POP3 authentication failed. In the inbox of the POP3 account I was using, I received an email from Google containing this message:

I clicked the “Learn More” Hyperlink and it took me to a place that lets me configure the POP account to use “Access for less secure apps”. After I turned this radio button to “on”. Authentication worked.


Hello, I’m running into this issue too. I did the diagnostics recommended above and got this error:

I’m a little bit lost - does that have something to do with the gmail configuration, or something on our server?

Please make sure you update to latest. This bug was fixed last week.


@gerhard currently running 2.4.0.beta4 which the admin says is latest. Is there another update?

Go to /admin/upgrade to update to latest.

1 Like

That page says I’m all up to date, so I’m not sure if I’m missing something.

You have to enter that url by hand, not get there from the admin page. Several new commits each day, so it’s unlikely that there are none.

I promise that’s what I’m doing :sweat_smile:

Is there another way to force it to get the absolute latest?

1 Like

Nope, that’s the latest version. It should be working…

Oh, I just reread your post. Yeah, those instructions in this topic are probably out of date. Are you actually seeing polling problems in Discourse as well? If so, you should see errors in /logs


Okay whew!

No errors in the logs, just no results. It was working fine and then stopped.


I also found the same issue. How do I fix it?

Did you try verifying your pop3 credentials (the username and password for checking the pop3 mailgox)? It appears that they no longer work.

1 Like