Re: Choose 'From:' address based on 'To: address

2021-03-02 Thread Alexander Huemer
On Thu, Feb 25, 2021 at 03:08:12PM -0500, Jon LaBadie wrote:
> On Thu, Feb 25, 2021 at 04:11:02PM +, Alexander Huemer wrote:
> > Hi
> > 
> > I am subscribed to several mailinglists and use different email
> > addresses for them, for various reasons.
> > Is there a configuration option to choose which 'From:' email address
> > shall be used if a mail to a certain 'To:' address is composed? If a
> > 'To:' address isn't in the mapping, then the 'set from' configuration
> > setting should be the fallback.
> > 
> > I somehow remember to have read years ago, that somebody has built a
> > workaround for this issue by hacking something into VIM with some code
> > completion feature that gives at least a way to choose an address from a
> > list, but I cannot find the reference to that anymore.
> > 
> > Any thoughts on this would be highly appreciated.
> 
> In a separate file I keep a bunch of mailing list send-hooks something
> like the following that is sourced into ~/.muttrc :
> 
> send-hook 'mutt-users@mutt.org' 'my_hdr From: "Jon LaBadie" 
> '
> 
> Depending on the mailing list I may also have a similar line for
> the Reply-To: header and a "set signature=..." to specify a unique
> signature file.

This works like a charm, thank you!

-Alex


Re: Choose 'From:' address based on 'To: address

2021-02-25 Thread Will Yardley
On Fri, Feb 26, 2021 at 08:55:45AM +1100, Cameron Simpson wrote:
> On 25Feb2021 09:56, Will Yardley  wrote:
> >On Thu, Feb 25, 2021 at 04:11:02PM +, Alexander Huemer wrote:

> >> Is there a configuration option to choose which 'From:' email address
> >> shall be used if a mail to a certain 'To:' address is composed? If a
> >> 'To:' address isn't in the mapping, then the 'set from' configuration
> >> setting should be the fallback.

> >I do something like this:
> >
> >set use_from
> >set from="lu...@example.net"
> >send-hook . 'unmy_hdr From:'
> >set reverse_name
> >alternates '(.*@example\.net|someuser@example\.com)'
> 
> reverse_name and alternates: this is only effective for personal email, 
> meaning email with one of your own addresses in the to/cc. Most mailing 
> lists do not do that, so there's no way to "reverse" from the to/cc to 
> the from of the reply.
> 
> You want Jon's send-hook based approach, setting from etc based on the 
> target address of the message you're composing.

Sorry, yes, I use that approach as well for lists - just in a different
section of my config

e.g.,

send-hook '~C ^mutt-users@mutt\.org$' 'my_hdr From: Will Yardley <...>'

w



Re: Choose 'From:' address based on 'To: address

2021-02-25 Thread Cameron Simpson
On 25Feb2021 09:56, Will Yardley  wrote:
>On Thu, Feb 25, 2021 at 04:11:02PM +, Alexander Huemer wrote:
>> Is there a configuration option to choose which 'From:' email address
>> shall be used if a mail to a certain 'To:' address is composed? If a
>> 'To:' address isn't in the mapping, then the 'set from' configuration
>> setting should be the fallback.
>
>I do something like this:
>
>set use_from
>set from="lu...@example.net"
>send-hook . 'unmy_hdr From:'
>set reverse_name
>alternates '(.*@example\.net|someuser@example\.com)'

reverse_name and alternates: this is only effective for personal email, 
meaning email with one of your own addresses in the to/cc. Most mailing 
lists do not do that, so there's no way to "reverse" from the to/cc to 
the from of the reply.

You want Jon's send-hook based approach, setting from etc based on the 
target address of the message you're composing.

Cheers,
Cameron Simpson 


Re: Choose 'From:' address based on 'To: address

2021-02-25 Thread Jon LaBadie

On Thu, Feb 25, 2021 at 04:11:02PM +, Alexander Huemer wrote:

Hi

I am subscribed to several mailinglists and use different email
addresses for them, for various reasons.
Is there a configuration option to choose which 'From:' email address
shall be used if a mail to a certain 'To:' address is composed? If a
'To:' address isn't in the mapping, then the 'set from' configuration
setting should be the fallback.

I somehow remember to have read years ago, that somebody has built a
workaround for this issue by hacking something into VIM with some code
completion feature that gives at least a way to choose an address from a
list, but I cannot find the reference to that anymore.

Any thoughts on this would be highly appreciated.


In a separate file I keep a bunch of mailing list send-hooks something
like the following that is sourced into ~/.muttrc :

send-hook 'mutt-users@mutt.org' 'my_hdr From: "Jon LaBadie" '

Depending on the mailing list I may also have a similar line for
the Reply-To: header and a "set signature=..." to specify a unique
signature file.


--
Jon H. LaBadie j...@labadie.us
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (703) 935-6720 (C)


Re: Choose 'From:' address based on 'To: address

2021-02-25 Thread Will Yardley
On Thu, Feb 25, 2021 at 04:11:02PM +, Alexander Huemer wrote:
> Is there a configuration option to choose which 'From:' email address 
> shall be used if a mail to a certain 'To:' address is composed? If a 
> 'To:' address isn't in the mapping, then the 'set from' configuration 
> setting should be the fallback.

I do something like this:

set use_from
set from="lu...@example.net"
send-hook . 'unmy_hdr From:'
set reverse_name
alternates '(.*@example\.net|someuser@example\.com)'

/w



Re: Choose 'From:' address based on 'To: address

2021-02-25 Thread ಚಿರಾಗ್ ನಟರಾಜ್
12021/01/15 04:66.00 ನಲ್ಲಿ, Alexander Huemer  ಬರೆದರು:
> 
> Hi
> 
> I am subscribed to several mailinglists and use different email
> addresses for them, for various reasons.
> Is there a configuration option to choose which 'From:' email address
> shall be used if a mail to a certain 'To:' address is composed? If a
> 'To:' address isn't in the mapping, then the 'set from' configuration
> setting should be the fallback.
> 
> I somehow remember to have read years ago, that somebody has built a
> workaround for this issue by hacking something into VIM with some code
> completion feature that gives at least a way to choose an address from a
> list, but I cannot find the reference to that anymore.
> 
> Any thoughts on this would be highly appreciated.
> 
> -Alex

set reverse_name=yes might do the trick (I had asked a similar question earlier 
and some kind soul pointed me to the right option!).

HTH!

- Chiraag
-- 
ಚಿರಾಗ್ ನಟರಾಜ್
Pronouns: he/him/his


publickey - mailinglist@chiraag.me - b0c8d720.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Choose 'From:' address based on 'To: address

2021-02-25 Thread Alexander Huemer
Hi

I am subscribed to several mailinglists and use different email 
addresses for them, for various reasons.
Is there a configuration option to choose which 'From:' email address 
shall be used if a mail to a certain 'To:' address is composed? If a 
'To:' address isn't in the mapping, then the 'set from' configuration 
setting should be the fallback.

I somehow remember to have read years ago, that somebody has built a 
workaround for this issue by hacking something into VIM with some code 
completion feature that gives at least a way to choose an address from a 
list, but I cannot find the reference to that anymore.

Any thoughts on this would be highly appreciated.

-Alex