POP3 polling stopped working

AI-generated summary

The discussion revolves around a POP3 polling issue in Discourse, where email-in and reply-by-email features stopped working. Users brianmcdonald, pelcami, and alexknowshtml report that re-enabling POP3 polling results in authentication failures. Debugging steps include checking server credentials, verifying SSL settings, and testing with net/pop in the Rails console. zogstrip suggests checking username/password and confirming Google account settings, noting that Google may have blocked polling from the server’s IP. pelcami received a suspicious email from Google indicating a possible security alert, suggesting that Google may have flagged the account. gerhard and pfaffman advise updating Discourse, but users confirm they are on the latest version. The issue appears to be related to Google’s security policies, possibly due to 2-step authentication or account verification requirements. bck055 also reports the same problem, indicating it may be widespread.

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.

안녕하세요, 저도 같은 문제를 겪고 있습니다. 위에 추천하신 진단을 수행해 보았는데, 다음과 같은 오류가 발생했습니다:

좀 혼란스러운데, 이것이 Gmail 설정과 관련이 있는 건가요, 아니면 저희 서버 쪽 문제인가요?

최신 버전으로 업데이트했는지 확인해 주세요. 이 버그는 지난 주에 수정되었습니다.

@gerhard 현재 2.4.0.beta4를 사용 중인데, 관리자가 최신 버전이라고 합니다. 다른 업데이트가 있나요?

최신 버전으로 업데이트하려면 /admin/upgrade로 이동하세요.

그 페이지에는 최신 상태라고 나와 있어서, 내가 뭘 놓치고 있는 건지 모르겠어요.

관리자 페이지에서 접근하는 것이 아니라, 해당 URL을 직접 입력해야 합니다. 매일 여러 개의 새로운 커밋이 추가되므로, 커밋이 하나도 없는 일은 거의 없습니다.

제가 지금 그걸 하고 있다고 약속합니다 :sweat_smile:

최신 버전을 강제로 가져오도록 하는 다른 방법이 있을까요?

아니요, 그게 최신 버전입니다. 작동해야 하는데…

아, 방금 질문을 다시 읽어봤습니다. 네, 이 주제에 있는 지침은 아마도 오래되었을 겁니다. 실제로 Discourse에서도 폴링 문제가 발생하고 있나요? 그렇다면 /logs에서 오류를 확인하실 수 있을 겁니다.

아, 다행이네요!

로그에는 오류가 없고, 결과만 안 나와요. 잘 돌아가다가 갑자기 멈췄거든요.

저도 같은 문제를 발견했습니다. 어떻게 해결해야 하나요?

pop3 인증 정보(이름과 비밀번호)를 확인해 보셨나요? 더 이상 작동하지 않는 것 같습니다.