email: Set an envelope-from which may be different from the From: field.

The envelope-from is used by the MTA if the destination address is not
deliverable.  Route all such mail to the noreply address.
This commit is contained in:
Alex Vandiver
2021-01-25 19:20:36 -08:00
committed by Tim Abbott
parent 173d2dec3d
commit e53be6d043
10 changed files with 50 additions and 12 deletions

View File

@@ -39,7 +39,8 @@ class EmailLogBackEnd(EmailBackend):
context = {
"subject": email.subject,
"from_email": email.from_email,
"envelope_from": email.from_email,
"from_email": email.extra_headers.get("From", email.from_email),
"reply_to": email.reply_to,
"recipients": email.to,
"body": email.body,