mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
🐛 Bug Report: SMTP fails to authenticate #324
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @reddwarf666 on GitHub.
Reproduction steps
Configure the SMTP settings to send emails and then press the "send test email" button.
Specific configuration I faced issues with:
Expected behavior
I expected the test email to be sent and arriving in my inbox
Actual Behavior
I got no email sent but have an entry in the logfile:
Version and Environment
Pocket-id version : 0.35.3
I tried to connect with smtp.office365.com in a terminal and I could connect without issues:
I tried to connect to the bash terminal in the docker container of pocket-id but could not get that to work or else I would have tested from inside the container.
Log Output
Error #01: failed to connect to SMTP server: failed to authenticate SMTP client: 504 5.7.4 Unrecognized authentication type [AM0PR10CA0128.EURPRD10.PROD.OUTLOOK.COM 2025-02-28T20:52:53.443Z 08DD571CFA2544C5]
@savely-krasovsky commented on GitHub:
To be honest I think they support only OAuth2 and Modern Auth. I think Golang SMTP auth ask server what types of auth it supports and only then tries to auth. It explains why you can auth manually by sending plain
AUTH LOGINcommand.@reddwarf666 commented on GitHub:
I just tried that server
smtp-mail.outlook.comand got the same error in the pocket-id log:Error #01: failed to connect to SMTP server: failed to authenticate SMTP client: 504 5.7.4 Unrecognized authentication type [AS4P192CA0018.EURP192.PROD.OUTLOOK.COM 2025-02-28T22:00:52.704Z 08DD583D79577268]
I don't think this is the correct serer address tbh and I can connect and authenticate with
smtp.office365.comand it is also used in other apps for sending email and that also works fine. THis seems to be something with either the SMTP fiunctionality in Pocket-id or something on my end or something inside the container.It's not like it cannot reach the
smtp.office365.comserver, it fails to authenticate so it should be something else...@savely-krasovsky commented on GitHub:
Did you try
smtp-mail.outlook.com?Source: https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040
Though it's strange anyway. I tried both STARTTLS (587) and TLS (465) with Fastmail, both worked.
@kmendell commented on GitHub:
Is the password your using a 'App Password'? or your actual outlook password?
@reddwarf666 commented on GitHub:
It is using a real password. Not sure if outlook is the thing here but I am not super confident to tell you otherwise.
I use the
smtp.office365.comserver and I think that is the right one, I use it in other docker containers to send email.@kmendell commented on GitHub:
the both resolve to the same thing i think. I do think the plainauth is causing the issue, i tested and confirmed i got the same thing.
@stonith404 commented on GitHub:
There was a problem with the refactor to the new library. Could you test the image again?
Strange 😅
@reddwarf666 commented on GitHub:
Hi
Just tried by
ghcr.io/pocket-id/pocket-id:development-go-smtpThe reponses I got in the logs of pocket-id-test:
Let me know if I did not use the new image as intended and I will adapt. And if any other testing is needed, feel free to ask!
EDIT: Microsoft is facing authentication issues across multiple services it seems, so testing is going to be hard. Who knows, maybe me testing SMTP authentication brought MS to it's knees? 😂
@kmendell commented on GitHub:
@stonith404 I think we may need to look into go-smtp based on the readme, the built in golang net/smtp is frozen and isnt getting features. Or this gist seems to provide workaround functionality to get 'login' nd 'xoauth' auth methods to work. https://gist.github.com/andelf/5118732
Another helpful link: https://stackoverflow.com/questions/57783841/how-to-send-email-using-outlooks-smtp-servers
@stonith404 commented on GitHub:
I've created a branch where I replaced
net/smtpwithgithub.com/emersion/go-smtpwhich supports theLOGINauth method. Would you mind to test theghcr.io/pocket-id/pocket-id:development-go-smtpimage and let me know if this fixes your issue?@reddwarf666 commented on GitHub:
Ok, it seems I was having some issues with licenses. I re-activated and all seems to be good again!
Again, I want to thank you guys for the speed responding and fixing it. Will wait to see when this is propagated to the normal docker images and start using this proper!
@stonith404 commented on GitHub:
Alright, thanks for the feedback. I'll release this ASAP.
@reddwarf666 commented on GitHub:
Tried it and got this in the logs:
But I'm having a tough time atm with Microsoft and Exchange and authenticating even Outlook, so I guess there is some issue on their end and that makes testing a bit unreliable. Anyway, if you have something to test once more then I'm here.
Odd thing is, on my mobile I could re-authenticate all accounts but on my macbook it seems to be problematic.
Hold on, I made a mistake by not pulling the new image, doh...
One moment please...
@reddwarf666 commented on GitHub:
Me again!
It worked! No idea why pocket-id could authenticate when I can't even get Outlook to do that but here we are.
I sent the test mail and it arrived, so something is working 😀
From the logs:
EDIT: just realised this makes no sense, Outlook wise, as why did I recieve that test email?
Anyway, your end of the functionality seems fine now! Thanks!