Re: Hooks for sending/replying to set a custom header

Subject: Re: Hooks for sending/replying to set a custom header

Date: Thu, 03 Oct 2024 10:22:56 -0700

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Xiyue Deng


Hi David,

David Bremner <david@tethera.net> writes:

> Xiyue Deng <manphiz@gmail.com> writes:
>
>> Let me start by saying that I have been enjoying notmuch recently and
>> wish I had tried notmuch much earlier.
>>
>> I do encounter a small issue on managing multiple email accounts: I set
>> `message-default-mail-headers' with the SMTP settings and email address
>> so that smtpmail can send the mail through my specified email address,
>> and would like to change this setting based on which address I'm sending
>> from.  However I'm having trouble finding the best place to set this in
>> notmuch when sending/replying.  AIUI notmuch does not really have the
>> concept of mail account, so this may require some manual handling.  I
>> tried to `re-search-forward' in notmuch-message-mode-hook for the `From:
>
>
> You could try out message-templ (elpa-message-templ in Debian). I'm
> using that to set the X-Message-SMTP-Method header, which sounds
> related.
>
> There is also message-server-alist, which does not need a header.

Thanks for the tip!  I think that should work, though I'd like a more
notmuch-ish solution if possible.  And in fact I had some success on
advising `notmuch-mua-mail' and reacting on 'From from `other-headers'.

I wonder whether notmuch may consider adding an abnormal hook that pass
in `headers' as an argument so that we don't need to use an advice?

-- 
Xiyue Deng
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: