Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mrep: Use first instead of last delivered-to to set from address #233

Open
xelxebar opened this issue Feb 12, 2023 · 5 comments
Open

mrep: Use first instead of last delivered-to to set from address #233

xelxebar opened this issue Feb 12, 2023 · 5 comments

Comments

@xelxebar
Copy link

xelxebar commented Feb 12, 2023

Overview

Commit e1e5bfe introduces a potential regression against 282de65. In cases where there are multiple Delivered-To headers, it is most likely that we want mrep to populate the sender address from the most public-facing Delivered-To, i.e. the first one; however, at the moment we are setting it to the address in the final (i.e. topmost and most internal-facing) one.

Why?

We have a posix setup that aliases multiple addresses into a virtual mailbox---e.g. all mails going to mars.*@example.com get glommed into [email protected]. The problem is that postfix aliases end up adding an additional Delivered-To header for each of these alias redirections. This is necessary to detect alias loops and related problems.

Patch points

The proposed change boils down to munging mcom:377. I believe we just need to reverse the order of headers passed to maddr and then tail -n 1 instead of head -n 1. However, it appears that maddr doesn't currently have a -M switch like mhdr, so maybe a patch there is needed as well?

Comments

Thoughts? Does the above sound reasonable?

@xelxebar
Copy link
Author

xelxebar commented May 1, 2023

@leahneukirchen @stacyharper Mind weighing in on this?

@stacyharper
Copy link
Contributor

About the use case I had, I only had one Delivered-To. If the fix continue to pick it, rather than the useless To, it is okay to me. Choosing the first Delivered-To seems okay and predictable to me

@leahneukirchen
Copy link
Owner

I guess both could be argued for, e.g. if you have multiple alias expansions they'll all end up as a Delivered-To..

I agree that maddr should parse repeated headers.

@leahneukirchen
Copy link
Owner

I also found multiple mailing lists ending up as Delivered-To...

@Anachron
Copy link

Jumping on this, I received a mail on an account I've put into my Alternate-Mailboxes setting but when replying to it via mrep it reverts the From: to default.

Is there a setting which lets me always use the To: address if it's inside the Alternate-Mailboxes setting? I couldn't find such a thing inside mcom.

If not, I may open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants