Django + Postfix password reset email is not sent

1

I've set up a server with my Django application and now I'm trying to enable password reset via email using postfix as an e-mail server.

I started configuring my views and testing if everything was correct through Django's console email backend .

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

When I log into my site and ask to reset the password, I see the email correctly appearing on my terminal.

Next I configured the postfix on my server. I also tested to see if it was working straightforward through the following command:

echo "Body" | mail -s "Subject" [email protected]

All right so far, the above email came in my test email.

After that I changed the settings.py :

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'Noreply <[email protected]>'

When I test the configuration in django shell :

from django.core.mail import send_mail
send_mail('Subject', 'Body', '[email protected]', ['[email protected]'], fail_silently=False)

Again everything happens as expected and the email arrives in my box.

But what does not work is when I access the password reset page of my site and enter with my email the email does not arrive!

In my journalctl -u postfix -xe I see the following messages:

postfix/smtpd[23411]: connect from localhost[127.0.0.1]
postfix/smtpd[23411]: 7BAED13D02E: client=localhost[127.0.0.1]
postfix/cleanup[23414]: 7BAED13D02E: message-id=<[email protected]>
postfix/qmgr[20567]: 7BAED13D02E: from=<[email protected]>, size=974, nrcpt=1 (queue active)
postfix/smtpd[23411]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
postfix/smtp[23415]: connect to gmail-smtp-in.l.google.com[xxxx:xxxx:xxxx:xxx::xx]:25: Network is unreachable
postfix/smtp[23415]: 7BAED13D02E: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[xxx.xxx.xxx.xxx]:25, delay=0.32, delays=0.01/0.01/0.1/0.21, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[xxx.xxx.xxx.xx] said: 550-5.7.1 [xxx.xxx.xx.xxx      13] Messages with multiple addresses in From: 550 5.7.1 header are not accepted. f12si6029290pln.103 - gsmtp (in reply to end of DATA command))
postfix/cleanup[23414]: CB6B913D030: message-id=<[email protected]>
postfix/qmgr[20567]: CB6B913D030: from=<>, size=3367, nrcpt=1 (queue active)
postfix/bounce[23416]: 7BAED13D02E: sender non-delivery notification: CB6B913D030
postfix/qmgr[20567]: 7BAED13D02E: removed
postfix/local[23418]: CB6B913D030: to=<[email protected]>, relay=local, delay=0.01, delays=0/0.01/0/0, dsn=5.1.1, status=bounced (unknown user: "noreply")
postfix/qmgr[20567]: CB6B913D030: removed

I think the tip is in 13] Messages with multiple addresses in From: 550 5.7.1 header are not accepted. f12si6029290pln.103 - gsmtp (in reply to end of DATA command) , but I do not know how to solve it ...

    
asked by anonymous 22.08.2017 / 16:37

0 answers