From: Arash Esbati <arash@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to dynamically select msmtp profile when sending a message?
Date: Thu, 13 Jun 2024 12:18:25 +0200 [thread overview]
Message-ID: <m2v82ddu32.fsf@macmutant.fritz.box> (raw)
In-Reply-To: 3d6fbb70-3ec7-45cb-958b-1dffce16cca0@app.fastmail.com
"Adham Omran" <lists@adham-omran.com> writes:
> I am trying to set up Emacs to send from multiple accounts, but I am
> facing two issues.
>
> In my `/etc/msmtprc` configuration I have two accounts.
>
> 1. If one if the accounts is named `default` it always uses and never
> automatically picks the correct account to send from based on my FROM
> header.
>
> 2. If I rename `default` to anything else like `personal` Emacs just
> fails to find anything to send from and throws
>
> ```
> sendmail: account default not found in /etc/msmtprc
> ```
>
> I want to be able to choose what account to send from, I fear this is
> somehow hard coded or not under user choice.
This is an example configuration from msmtp webpage[1]:
--8<---------------cut here---------------start------------->8---
# Set default values:
defaults
port 587
tls on
tls_starttls on
# Define a mail account at a freemail service
account freemail
host smtp.freemail.example
from joe_smith@freemail.example
auth on
user joe.smith
# Some other mail service
account company
host mail.company.example
from smithjoe@company.example
auth on
user company12345
# Set a default account
account default : freemail
--8<---------------cut here---------------end--------------->8---
So it should work if you're following the above.
Best, Arash
Footnotes:
[1] https://marlam.de/msmtp/msmtprc.txt
next prev parent reply other threads:[~2024-06-13 10:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 21:02 How to dynamically select msmtp profile when sending a message? Adham Omran
2024-06-13 10:18 ` Arash Esbati [this message]
2024-06-13 13:32 ` Adham Omran
2024-06-13 14:35 ` Arash Esbati
[not found] ` <871q506apa.fsf@gilgamesh.mail-host-address-is-not-set>
2024-06-13 17:24 ` Arash Esbati
2024-06-14 5:32 ` Bob Newell
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2v82ddu32.fsf@macmutant.fritz.box \
--to=arash@gnu.org \
--cc=help-gnu-emacs@gnu.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.
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).