gitea
gitea copied to clipboard
mailer: add option to override mail headers
Add option to override headers of mails, gitea send out
Sponsored by Kithara Software GmbH
If I understand these headers correctly:
Return-Pathis for bounced error e-mails only, e.g. sent by smtp servers, not by usersReply-Tois what the clients will reply to
So maybe you are really looking for Reply-To?
I'll test how mailclients do react ...
We should only set Reply-To when it's different than From because:
Some email clients issue a warning message when Reply-To: is set
I do see we already set this header on line 54, so maybe just improve it in this regard.
This seems like it would conflict with the reply to issues via email functionality as that relies upon a specific address?
Well yes i'll add a check so it does not conflict.
The usecase i try to solve: have a mail in from header witch is not "noreplay@..." but let mail clients still not replay to it (or show at least a warning)
I guess in any case, having this Return-Path option will be good to have, even thought it does likely not solve your use case.
Happy to merge this as-is for the Return-Path option. Could add check to compare it to FROM and skip setting it if equal but it would need to perform rfc5322 format-splitting (John Doe <[email protected]>) to make them comparable.
Is it really changeable from sender side?
https://www.rfc-editor.org/rfc/rfc5321
When the delivery SMTP server makes the "final delivery" of a
message, it inserts a return-path line at the beginning of the mail
data. This use of return-path is required; mail systems MUST support
it. The return-path line preserves the information in the <reverse-
path> from the MAIL command. Here, final delivery means the message
has left the SMTP environment. Normally, this would mean it had been
delivered to the destination user or an associated mail drop, but in
some cases it may be further processed and transmitted by another
mail system.
https://stackoverflow.com/questions/1235534/what-is-the-behavior-difference-between-return-path-reply-to-and-from
Only the recipient's mail server is supposed to add a Return-Path header to the top of the email.
This records the actual Return-Path sender during the SMTP session.
If a Return-Path header already exists in the message,
then that header is removed and replaced by the recipient's mail server.
well yes ... it's just an edgecase to outlook
I'll make it more generic ...
just need testing if it works as expected :)
Before
Now
BTW I just checked: Multiple headers values split on , and sub-values split on ; and I think this is true for both mail and http headers.
BTW I just checked: Multiple headers values split on
,and sub-values split on;and I think this is true for both mail and http headers.
well we now just make a pass-through more or less ...
Interesting block syntax, where's it from? At least GFM can't seem to render it.
Interesting block syntax, where's it from? At least GFM can't seem to render it.
docusaurus buildin syntax
https://docusaurus.io/docs/markdown-features/admonitions
Interesting block syntax, where's it from? At least GFM can't seem to render it.
docusaurus buildin syntax
https://docusaurus.io/docs/markdown-features/admonitions
Thanks, I see https://github.com/facebook/docusaurus/issues/7471 is related.
It's better to have a test.
It's better to have a test.
added