all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arash Esbati <arash@gnu.org>
To: Adham Omran <lists@adham-omran.com>
Cc: "emacs-help" <help-gnu-emacs@gnu.org>
Subject: Re: How to dynamically select msmtp profile when sending a message?
Date: Thu, 13 Jun 2024 19:24:31 +0200	[thread overview]
Message-ID: <m234pg7o34.fsf@macmutant.fritz.box> (raw)
In-Reply-To: <871q506apa.fsf@gilgamesh.mail-host-address-is-not-set> (Adham Omran's message of "Thu, 13 Jun 2024 19:58:57 +0300")

Adham Omran <lists@adham-omran.com> writes:

> This configuration set made it work for me!
>
> I do not know what the issue was but I suspect it was not reading from
> the headers properly, thank you very much.

You're welcome.  This is from msmtp manual[1]:

  3.3 Choosing an account

  There are three ways to choose the account to use.

  1. --account=account
  Use the given account. Command line settings override configuration
  file settings.
  2. --host=hostname
  Use only the settings from the command line; do not use any
  configuration file data.
  3. --from=address or --read-envelope-from
  Choose the first account from the system or user configuration file
  that has a matching envelope-from address as specified by a from
  command. This works only when neither --account nor --host is used.
  Subadresses are supported. For example, the envelope from address
  user+detail@example.com will match the account for user@example.com.
  Furthermore, the envelope-from address of the account may be a
  wildcard pattern. See from.

  If none of the above options is used (or if no account has a
  matching from command), then the account "default" is used.

The tricky part is to tell msmtp about item 3. which is done by setting
the variables in my message upthread.

Best, Arash

Footnotes:
[1]  https://marlam.de/msmtp/msmtp.html#Choosing-an-account-1



  parent reply	other threads:[~2024-06-13 17:24 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m234pg7o34.fsf@macmutant.fritz.box \
    --to=arash@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=lists@adham-omran.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.