Check also X-Original-To header when processing MIME headers

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Check also X-Original-To header when processing MIME headers

Post by SorenR » 2022-03-26 14:38

RvdH wrote:
2022-03-26 13:10
SorenR wrote:
2022-03-26 12:54
Not sure I agree on the "To,Cc" included in the list.

What is the rationale for including them in the "MIME Headers" when they are clearly addressed further down the code in the event NO "MIME Headers" are populated?

There has to be a deeper meaning for Martin to split them up like this ...
That is because you have this https://github.com/hmailserver/hmailserver/pull/251 pull request included, not?
So asking martin has little use, it is no code coming from him but the pull request you included but that never made it to any official builds
Just look at the original code, both To and CC are included there as well and normally are NOT addressed further down

That commit makes not much sense to me to be honest, why would you first try the others? You instruct it to "Deliver to recipients in MIME headers" when that checkbox is enabled (last time i checked To and CC are MIME headers as well), and the RecipientParser clears out the doubles, if any
https://github.com/hmailserver/hmailserver/issues/250 tells "some" servers don't do that correctly, but should we change our (intended) functionality because of that?
bool ProcessMIMERecipients

Read message recipients from To/CC headers.
https://www.hmailserver.com/documentati ... tchaccount


But maybe To and CC should be fixed headers (eg: always parse even when not defined in the possible MIME headers), but with testing (split & join) in mind i simply included them
You've got a point there. #251 was 4 years ago, no wonder it did not ring a bell... And yes, To and Cc are also MIME headers ;-)
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Check also X-Original-To header when processing MIME headers

Post by RvdH » 2022-03-26 18:14

Just brainstorming, few options here:
  1. Always try to parse To, CC + any optional additional defined headers
  2. Define all MIME recipient headers to be parsed, which basically gives the opportunity to leave out To and/or CC (eg: a bit like pull #251 handles this and issue #250 describes)
Example (option 1)
ExternalAccount.png
But i am a bit hesitated, maybe option 2 is more suitable and more flexible, not?
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Check also X-Original-To header when processing MIME headers

Post by SorenR » 2022-03-26 18:40

Option 2...

To and CC are easily faked so should be prioritized lower than system generated MIME headers.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Check also X-Original-To header when processing MIME headers

Post by RvdH » 2022-03-26 19:55

Thats the GUI (for now), still have to rewrite all the variables in hmailserver itself to be named properly for option 2
"To,CC,X-RCPT-TO,X-Envelope-To" should be The default, for backward compatibility, or "To,CC,X-RCPT-TO,X-Envelope-To,X-Original-To"?

Next issue, what is they empty the MIME recipient headers textbox? Restore defaults?
Or leave empty end disable the "Deliver to recipients in MIME headers" checkbox on saving?
Attachments
ExternalAccountNew.png
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Check also X-Original-To header when processing MIME headers

Post by SorenR » 2022-03-26 20:07

Error message. Enter headers or deselect.

If you deselect with empty box -> nothing
Select with empty box -> populate with default.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

LacaK
New user
New user
Posts: 28
Joined: 2022-02-01 14:35

Re: Check also X-Original-To header when processing MIME headers

Post by LacaK » 2022-03-26 21:18

As I wrote from my POV it is perfectly sufficient have hard-coded list of processed MIME headers - To, Cc, X-RCPT-To, X-Envelope-To, Envelope-To, X-Original-To (simplest straighforward implementation with 1-2 lines of new source code)
As far as I can say processing recipient in these headers should not cause unwanted deliveries.

The only reason why I proposed to provide this list as configurable option was comment from RvdH: "i already hesitated to add another non-rfc header". This comment leads me to proposal - have this list as configurable if there is problem with non-standard headers.

But if this feature is alredy implemented then keep it.

1. I would put on first place in tab-position checkbox "Deliver to recipients in MIME headers"
2. If this option is checked then subsequent editbox "MIME recipients headers" (I would name it "Processed MIME headers") will be enabled. I will put then idented under checkbox "Deliver to recipients in MIME headers".
3. If editbox will be left blank then it will automatically deselect checkbox "Deliver to recipients in MIME headers"
4. If checkbox "Deliver to recipients in MIME headers" will be toggled from unselect to select state then subsequent editbox will be populated with default values "To,CC,X-RCPT-TO,X-Envelope-To,X-Original-To"

User avatar
RvdH
Senior user
Senior user
Posts: 3231
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: Check also X-Original-To header when processing MIME headers

Post by RvdH » 2022-05-11 10:54

CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

Post Reply