Answer the question
In order to leave comments, you need to log in
Letters from the site on Django through Yandex do not reach. Where to dig?
Damn!!!
I'm trying to send password recovery emails from a Django forum via SMTP via smtp.yandex.ru. Mail for the domain is connected and configured. I checked sending from several machines (including the server) to several different mailboxes on Gmail, Mail.ru and Yandex. It comes to all mailboxes perfectly and instantly, it does not fall into "spam".
To celebrate, I dumped everything into production ... and it started! There was anger from users that the password recovery email did not reach! I myself have already driven the addresses of real registered users into the recovery form - they don’t reach, and that’s it!
Moreover, interestingly, some users were able to create new accounts on the forum and write to me about the problem, although when registering a new account, activation via mail is also required. Some said that activation falls in "Spam".
Prompt where to dig???
Here is the send config:
if True:
# EMAIL_TIMEOUT = 5
EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_PORT = 465
# EMAIL_PORT = 587
EMAIL_USE_SSL = True
# EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '*******'
DEFAULT_FROM_EMAIL = 'Сайт.ру <%s>' % EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER
Answer the question
In order to leave comments, you need to log in
So far, I have implemented the digital signature of DKIM messages, as described in the manual https://djangosnippets.org/snippets/1995/ .
Let's see...
PS: The private part of the key is taken through the Yandex.Mail API.
UP 2 weeks later FOUND!
Well, who would have thought! Everything turned out to be ridiculously simple.
Looking at the Django source django.contrib.auth.forms.py in the PasswordResetForm class:
def get_users(self, email):
...
return (u for u in active_users if u.has_usable_password())
It worked for me with the following settings (now I send through my mailer):
EMAIL_HOST_YA = 'smtp.yandex.ru'
EMAIL_PORT_YA = 587
EMAIL_HOST_USER_YA = '[email protected]'
EMAIL_HOST_PASSWORD_YA = '1234'
from django.core.mail import get_connection, send_mail
#connections to yandex
connection = get_connection(
host=settings.EMAIL_HOST_YA,
port=settings.EMAIL_PORT_YA,
username=settings.EMAIL_HOST_USER_YA,
password=settings.EMAIL_HOST_PASSWORD_YA,
use_tls=True
)
send_mail(
subject,
text_content,
from_email,
to,
connection=connection,
html_message=html_content
)
the number of letters per minute
and per day
limits, in short,
the exhaustive answer is very simple: washed for Yandex like Gmyl for Google - advertising and market share, therefore, if they stop using it, they will not be happy, therefore - tough antispam. It's one thing - meaningful letters from different addresses to different addresses (such as a regular corporate letter), another thing - use such technical
services, but there are completely free limits
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question