Ask for which account to send email from?

2022-10-05 Thread Ranjan Maitra
Hi,

I have been using mutt for all my emailing for a couple of years now. I have 
multiple accounts, and the way I get this resolved is that I have different 
folders where different accounts are used (all configured in my .muttrc). This 
works at least sort of reasonably, except when I have to forward or send an 
email (using an account) to something else that is on a different account. I am 
not sure how to handle this, and would like to have ideas, but at the very 
least, I wonder if I can get a prompt asking which account I should send my 
email from. Ideally, if I choose an account (email address), then that account 
should get picked.

Any suggestions, as to how I should handle this?

Many thanks for your time, and help!

Best wishes.
Ranjan


Re: Ask for which account to send email from?

2022-10-05 Thread P. Mazart
Hi Ranjan,

Ranjan Maitra schrieb am 06.10.2022 03:53:38:
> I have multiple accounts, and the way I get this resolved is that I
> have different folders where different accounts are used (all >
> configured in my .muttrc).

As a first step I recommend using a folder-hook to source a config file
that changes your smtp-settings like so:

folder-hook '+PMazart' 'source ~/.mutt/incl-ident-pmazartwebde'

Within this config file may be:
set sendmail="/usr/bin/msmpt -a yourconfig"
set realname=Ranjan

and so on.

If you need to change your account manually you could do something like:
macro compose,index,pager "\ca1" ':source 
~/.mutt/incl-ident-pmazartWHATEVER' 'use pmaz...@whateverdoesnotexist.cn'
macro compose,index,pager "\ca2" ':source 
~/.mutt/incl-ident-pmazartwebde' 'use pmaz...@web.de'

With this you can use CTRL+A then 1 or 2 to change your smtp-configs.

You can additionally consider changing compose_format, status_format and
pager_format to mention the currently used email address within those
include files.

Best Regards,
Peter