<<< Date Index >>>     <<< Thread Index >>>

Re: Hook for changing msmtp account



Salvatore Iovene <salvatore@xxxxxxxxxx> writes:

> Yeah, but _which_ smtp server, among the ones defined in the
> .msmtprc file? My doubt comes from the fact that msmtp seems to
> identify the various smtp account by an unique name in the "account"
> property of the configuration file, and not simply by the used
> From:.

It will choose the account to use based on the envelope from.


> I mean, what if I wanted then to use two smtp servers but same From:
> address?

I suppose you want to choose the smtp server based on the current
folder then. Something like this perhaps (untested):

folder-hook .          'set sendmail=/usr/bin/msmtp --account mainaccount'
folder-hook somefolder 'set sendmail=/usr/bin/msmtp --account anotheraccount'

-- 
Nicolas