Can send emails from shell but allauth emails are not sent #3522
Replies: 2 comments 1 reply
-
I decided to go with Gmail, since it’s presented as the universal solution everywhere I saw a report of this issue. It works. It’s a bit sad to be “forced” into a provider because of a bug, though. |
Beta Was this translation helpful? Give feedback.
-
We are using a mailserver running Postfix to send emails from our domain. We originally had the above problem. After checking Postfix errors in syslog we could see that the emails were being sent from "webmaster@localhost" and therefore being rejected by Gmail because of the unverifiable domain. The fix was to set DEFAULT_FROM_EMAIL in settings.py to something that from your domain that Gmail can confirm. We went with "[email protected]" and emails started getting through. At least to some addresses. This is not an all-auth setting it's a Django setting. Not sure if this was your problem. But hope this helps someone in the drawn out process of sending some emails from Django. |
Beta Was this translation helpful? Give feedback.
-
Preamble: allauth works fine on my local dev instance. The issue only happens once deployed on my cloud infra.
Once deployed, I can still send emails from manage.py shell but when interacting with the website, allauth emails are never sent.
I can see the dummy users I create and their (unverified) emails in the admin but I never receive the verification emails.
Does anyone have any idea what is going on or where to start debugging?
I am willing to investigate and try to fix the bug myself, as I understand it's probably impossible to reproduce this behaviour out of the blue. I would appreciate some guidance though, as I have no experience with allauth or Django mail.
Note 1: I also asked for help on Django forum.
Note 2: My issue seems a modern duplicate of this one raised in 2017 in Allauth Google Group, with more recent versions (python 3.11 and Django 4.2)
Beta Was this translation helpful? Give feedback.
All reactions