From: "João Pedro" <jpedrodeamorim@gmail.com>
To: alan.schmitt@polytechnique.org, notmuch <notmuch@notmuchmail.org>
Subject: Re: changing smtp server and signature depending on from address
Date: Mon, 25 Apr 2022 19:14:40 -0300 [thread overview]
Message-ID: <87a6c84xpr.fsf@gmail.com> (raw)
In-Reply-To: <87czhcgks1.fsf@m4x.org>
On 20 April 2022 11:35, alan.schmitt@polytechnique.org wrote:
> Hello,
Hi Alan!
> I use several email addresses, and I would like to customize the smtp
> server and the signature I use for each of them. Is there a notmuch way
> of doing this?
I don't think notmuch has a built-in/default way of doing it, but
notmuch itself recommends using gnus-alias [1], like others have
recommended.
I myself have come up with my own system, which gets the information for
the addresses from auth-source [2]. It basically consists on an alist
that assigns an "alias" for each address and holds its information as a
plist. So, assuming I have a personal and work accounts, the alist would
be something like
((personal
(:address . "jpedrodeamorim@gmail.com")
(:name . "João Pedro")
(:host . "smtp.gmail.com")
(:key . "p")
(:signature . "João Pedro de Amorim Paula
IT undergraduate at Universidade Federal do Rio Grande do Norte (UFRN)"))
(work
(:address . "jpedrodeamorim@work.com")
(:name . "João Pedro")
(:host . "smtp.gmail.com")
(:key . "w")
(:signature . "João Pedro de Amorim Paula
Clojure(Script) engineer at Flexiana")))
The :key is something I assign by hand to each of my mail addresses, and
which I use to quickly choose with a single character using read-answer
[3].
I also have a couple of helper functions to correctly infer the account
I am using, and the information that smtpmail [4] needs to send my
e-mails (they are also store in auth-source, no sensitive information is
stored in plain text).
If you're interested, I could follow up on this thread detailing a
little more of how I glue it all together (by "it" I mean notmuch and
Emacs built-in Message and mail libraries), with the functions I use and
all. It currently isn't available in a public repo because I still have
some sensitive information that I need to have cryptographed before
doing so.
[1] https://notmuchmail.org/emacstips/#index16h2
[2] https://www.gnu.org/software/emacs/manual/html_mono/auth.html
[3] https://www.gnu.org/software/emacs/manual/html_node/elisp/Multiple-Queries.html
[4] https://www.gnu.org/software/emacs/manual/html_mono/smtpmail.html
--
João Pedro de Amorim Paula
IT undergraduate at Universidade Federal do Rio Grande do Norte (UFRN)\r
next prev parent reply other threads:[~2022-04-25 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 9:35 changing smtp server and signature depending on from address alan.schmitt
2022-04-20 10:15 ` Dan Čermák
2022-04-20 12:37 ` Alan Schmitt
2022-04-25 22:14 ` João Pedro [this message]
2022-04-26 5:54 ` Alan Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6c84xpr.fsf@gmail.com \
--to=jpedrodeamorim@gmail.com \
--cc=alan.schmitt@polytechnique.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).