I am using gmail smtp in my django website. I have a contact form where user put email and message then I send a mail to the admin with :
email = EmailMessage('email subject', 'email message', settings.EMAIL_HOST_USER,
['admin.mysite@gmail.com'],
headers = {'Reply-To': 'user@foo.bar',
'Sender': 'user@foo.bar','from': 'user@foo.bar','Return-Path': 'user@foo.bar'})
email.send(fail_silently=False)
email is sent/received correctly but when admin client select reply in gmail, it always reply to the settings.EMAIL_HOST_USER and not the user address. On the email original header the From and Return-path are set with the setting.EMAIL_HOST_USER
If you use smtp.gmail.com to send a message, and the sender's email address is not yourgoogleemailname@gmail.com, then Gmail will rewrite the headers and set the from address to yourgoogleemailname@gmail.com. See http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server for more info, and for a possible solution.
Django 2.1.7
Google violates the RFPs defining the expected operation of an SMTP server, rewriting the headers. This may be the root cause of your problem: http://lee-phillips.org/gmailRewriting/