[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to dynamically select msmtp profile when sending a message?
From: |
Arash Esbati |
Subject: |
Re: How to dynamically select msmtp profile when sending a message? |
Date: |
Thu, 13 Jun 2024 12:18:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
"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