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.enable_ssl
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?

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.
https://support.google.com/accounts/answer/6010255

你好,我也遇到了这个问题。我按照上述建议进行了诊断,得到了以下错误:

我有点摸不着头脑——这是否与 Gmail 配置有关,还是我们服务器上的问题?

请确保您已更新至最新版本。此漏洞已于上周修复。

@gerhard 目前运行的是 2.4.0.beta4,管理员说这是最新版本。还有其他更新吗?

前往 /admin/upgrade 更新至最新版本。

该页面显示我已全部更新完毕,所以我不确定是否遗漏了什么。

你必须手动输入该 URL,而不能从管理页面进入。每天都有多次新的提交,因此不太可能没有任何更新。

我保证我正在这么做 :sweat_smile:

还有其他方式能强制获取绝对最新版本吗?

不,那是最新版本。应该能正常工作……

哦,我刚刚重新读了你的帖子。是的,这个话题中的那些说明可能已经过时了。你在 Discourse 中是否也遇到了轮询问题?如果是,你应该能在 /logs 中看到错误信息。

呼,太好了!

日志中没有错误,只是没有结果。之前运行正常,后来就停了。

我也遇到了同样的问题。该如何修复?

您是否尝试过验证您的 POP3 凭据(用于检查 POP3 邮箱的用户名和密码)?看起来它们已无法使用。