-
Notifications
You must be signed in to change notification settings - Fork 47
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: Set From header according to To/Cc header #173
Conversation
This is a good idea, but there are some cases that require more thought: if you are in Cc with address only, your from doesn't contain the real name e.g. Probably an improvement over the status quo, however. |
Good point, RFC 5322 addresses complicate this setup quite a bit. For example, my assumption was that |
I think alternate-mailboxes should just contain the addresses. maddr -a can print the address only, i guess adding maddr -d would be useful. |
Edit: nvm, this doesn't really solve the problem, but might be better than a plain grep if someone messes with comments in addresses etc. |
Good to know, but the |
Perhaps we can use a different header in the configuration for this feature. Then map that by address to the given displayname. |
Just to make sure I understood you correctly: You are proposing adding an additional header to |
Exactly. |
I added |
not sure we need that actually, but it's an obvious feature. |
Pushed a change which utilities
I personally find it very handy, but if you don't want it that's fine as well. |
The more compilated version which also handles a missing description in addr=$(maddr -a -h to:cc:bcc: "$1" | grepmine | head -n 1)
if [ -n "$addr" ]; then
desc=$(maddr -d -h "local-mailbox" "$MBLAZE/profile")
if [ -n "$desc" ]; then
from=$(printf "%s <%s>" "$desc" "$addr")
else
from=$addr
fi
else
from=$(mhdr -h local-mailbox "$MBLAZE/profile")
fi |
Well, I have some private addresses that are listed as Alternative-Mailboxes to get the |
It would certainly be possible to add a new
Why would that be a problem? Unless I am missing something here the code should fallback to If you generally disagree with the feature I will just apply my patch locally. If you like the idea in general but don't like the implementation I can try to adjust it. Either way is fine with me. |
I'm thinking of a slightly more general feature, something like
|
We could default addrs to alternative-mailboxes if reply-from is empty (having full names there should also be ok). |
Sure, that would work for me 👍 |
Implemented (i.e. copied) your implementation. Also added some documentation to |
We could default to Sorry, I lost track of this PR in my todo list. |
If any of the address contained in the aforementioned headers matches an address configured in the Reply-From header in mblaze-profile(5). Without this change, mrep(1) uses the mail address configured as Local-Mailbox for the From header. While generally desirable, I use different mail addresses for different proposes. As such, I do not want to reply to mails I received through my work address with my private email address.
Sure but imho that would complicate the code a bit (more case distinctions) as the fallback is needed both here: Lines 19 to 20 in 4e4dcdf
and here: Line 367 in 4e4dcdf
So did I. |
Added some experimental fallback code. |
Have my eye on this feature. The list of emails I have to reply as is very long and constantly growing. Would it make sense to allow wildcards or regex specifications in Unfortunately Thoughts? |
Do we really need something more complicated than |
I mangled this into 282de65, please test. |
Beautiful.
Thank you. Will do. |
I use different mail addresses for different purposes. When replying to
any email,
mrep(1)
currently uses the mail address configured asLocal-Mailbox
for the From header. While generally desirable, I do notwant to reply to mails I received through my work address with my
private email address.
This commit introduces a change which uses the email address, the email
was sent to, (as specified by To/Cc) for the From header, as long as this
address was configured as an
Alternate-Mailboxes
. I just quickly hackedthis together as a proof of concept without much further considerations.
Seems to work though but not sure if it is generally desirable to enable
this behaviour by default, let me know what you think.