From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Newell Newsgroups: gmane.emacs.help Subject: Re: How to dynamically select msmtp profile when sending a message? Date: Thu, 13 Jun 2024 19:32:50 -1000 Message-ID: References: <3d6fbb70-3ec7-45cb-958b-1dffce16cca0@app.fastmail.com> <00aa97e5-f947-45bd-bee7-64716dbaa4d6@app.fastmail.com> <871q506apa.fsf@gilgamesh.mail-host-address-is-not-set> Reply-To: bobnewell@bobnewell.net Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3450"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 14 07:33:43 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sHzZG-0000gO-RX for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 14 Jun 2024 07:33:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHzYi-0003H8-VV; Fri, 14 Jun 2024 01:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHzYh-0003Gw-I8 for help-gnu-emacs@gnu.org; Fri, 14 Jun 2024 01:33:07 -0400 Original-Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHzYd-00039A-K5 for help-gnu-emacs@gnu.org; Fri, 14 Jun 2024 01:33:07 -0400 Original-Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-6327e303739so2527377b3.2 for ; Thu, 13 Jun 2024 22:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail-com.20230601.gappssmtp.com; s=20230601; t=1718343182; x=1718947982; darn=gnu.org; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0+PR8llLEDdlGjVvqQyPnwQ7bHiOG7eSFda1xDxG0zM=; b=iTtqTjvfx4R0mBj3H6HY7I7H0BmhHcRKrt8NVUHjaiqKenORBuoS2VVx7Hy7/KHxRI LqYEPR8rHW13gmin6Oi8s15AVN2CiSTHXtifPLnTNFZqe10eMTdQovL0nIAovSv1M3RY FtBarhxZo2N83R2vJPFOfE4MYULH5rikfAsOqthOgLpFR54ex7f3g4FHy+CyfoTzfPZh KaVt0Y4T8WFBEkOCbLv+JakhN8IrwI2L1MjWRcIW1zbMaf0EwLsseLVramMFjoidZTSB Xa/TI98dd3wiN5CzZsTaa5J5/IVOol+KoRe7CVIDb9RjfraExjK1BgS/SEI+OpWQEMRp UMHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718343182; x=1718947982; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0+PR8llLEDdlGjVvqQyPnwQ7bHiOG7eSFda1xDxG0zM=; b=MjrOJgkITjt0CcUYvTHyD/VUZESqaJHYbdaCzGMNSo4xuZdvf0B01bj1sBMQhMuZM5 /a5fGPHUblHBdL/fIuufEEaN8R3yBOaMY75xVo9Q+aLzBJ9S1sAqj1KPACh9Gec+oPdl X/aj+eFERKlc5nSS0+bIMepGx9z9lnY0qkbb6wpc5TNNajxmYuDVVHvNfllODD9PGA9R TbGnjd3e512eeyFYExLFboxzvnJDKzqO2SR+gKM8PPyWaQ6awZ8UaS+038ZGtkBxvkFc SPhkVft9zXchb68Fa1JSetaqvhpNtMc7YqOqM8/ZwtbsxkjoBShnZtL/5Y7Zvl5hGRr5 2xGA== X-Gm-Message-State: AOJu0YyvevNBtCrqUqVe2mu8YND5fhce3e+BOVZBmGXdlcvXG48s39jC 4+pf9Gm8mPYG2J4hkKxdrQKz8TtJm8wUatoB6B3KZ0yRM4ys7JOY4I5Ke3V3w4BW4+QUkCSmjJm vzLd9rODUt90+LGi68oTDStBJPDSqFbGc X-Google-Smtp-Source: AGHT+IFJTXYxoAiT7XrrOCkLw8nhRG43V8JaskXA+2jic4rKiE/Tqr6R7qkPamEJXLuoA6hrlMKgAfSmkLw+ISlk7mg= X-Received: by 2002:a25:8208:0:b0:df4:8397:e7ed with SMTP id 3f1490d57ef6-dff15508365mr1377717276.62.1718343181998; Thu, 13 Jun 2024 22:33:01 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1135; envelope-from=chipschap@gmail.com; helo=mail-yw1-x1135.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146892 Archived-At: FWIW, I can confirm that the "secret sauce" is (setq message-send-mail-function 'message-send-mail-with-sendmail message-sendmail-f-is-evil 't sendmail-program "/usr/bin/msmtp" message-sendmail-extra-arguments '("--read-envelope-from") ) which is similar to that shown above (your msmtp path of course may vary). I've successfully used msmtp with Emacs/gnus for years with a ridiculous number of email addresses and accounts. (It can actually be lots of fun, especially if used in combination with gnus aliases.) Bob Newell Honolulu