sending email using different server for different 'From:' field

Mark Walters markwalters1009 at gmail.com
Wed Sep 3 01:31:55 PDT 2014


Hi

On Wed, 03 Sep 2014, David Belohrad <david at belohrad.ch> wrote:
> oukej. this seems to be exactly what I'm looking for. Is there a way how
> to 'cycle' in notmuch different From: fields? I'd need to setup like 3
> addresses, each of them with different signatures and be able to easily
> switch between them....

You might finding setting notmuch-always-prompt-for-sender to 't is
what you want (you can set if in customise or directly)

This prompts you for the sender address and takes options from your
notmuch config file (that is from user.primary_email and
user.other_email from .notmuch-config) so will quite possibly just work.


>>
>> (defun kea/message-select-mail-dest ()
>>   (cond ((string-match "<kea at x.com>"
>>                        (message-field-value "From"))
>>          (kea/send-mail-with-x))
>>         (t
>>          (kea/send-mail-with-y))))
>>
>> (kea/send-mail-with-y)
>> (add-hook 'message-send-hook 'kea/message-select-mail-dest)

I will also mention an alternative approach to using hooks here. You
could customise message-send-mail-function to be your own function which
let binds the appropriate send-mail settings and have that call the
actual send-mail function (eg message-send-mail-with-sendmail)

Best wishes

Mark



More information about the notmuch mailing list