mblaze, a Maildir-focused command line mail client
 help / color / mirror / code / Atom feed
From: attila <attila@stalphonsos.com>
To: mblaze@googlegroups.com
Subject: patch to mcom to make using msmtp easier w/multiple identities
Date: Tue, 21 May 2019 10:25:16 -0500	[thread overview]
Message-ID: <2KMER8ALDHL5P.2W76F2CU2HZ76@stalphonsos.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]


Hi fellow mblazers,

Attached is a patch to mcom from mblaze 0.5.1 that I use to get
msmtp to properly decide which SMTP server to use based on the From
address.  Am not particularly attached to this way of doing things,
this is just what's working for me now.  To use it, I put

    sendmail: /usr/local/bin/msmtp
    auto-from: -f

in my ~/.mblaze/profile and set the From address to match the "from"
directives in each stanza of my msmtp config.

Pax, -A

-- 
You received this message because you are subscribed to the Google Groups "mblaze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mblaze+unsubscribe@googlegroups.com.
To post to this group, send email to mblaze@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mblaze/2KMER8ALDHL5P.2W76F2CU2HZ76%40stalphonsos.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: mcom.patch --]
[-- Type: text/plain, Size: 726 bytes --]

--- /usr/local/bin/mcom	Tue Oct  2 15:38:41 2018
+++ /home/attila/bin/mcom	Sat Apr 27 10:44:44 2019
@@ -73,6 +73,7 @@ sendmail=$(mhdr -h sendmail "$MBLAZE/profile")
 sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
 sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
 default_from=$(mhdr -h local-mailbox "$MBLAZE/profile")
+auto_from=$(mhdr -h auto-from "$MBLAZE/profile")
 
 hdrs=
 resume=
@@ -351,6 +352,10 @@ while :; do
 			sendmail="${sendmail:-sendmail} -- $resent"
 			;;
 		esac
+		if [ -n "$auto_from" ]; then
+			from="$(echo $draft | maddr -a -h from)"
+			sendmail="${sendmail} ${auto_from} ${from}"
+		fi
 
 		if [ -e $draftmime ]; then
 			if [ $draft -ot $draftmime ] || [ "$automime" -eq 1 ]; then

             reply	other threads:[~2019-05-21 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 15:25 attila [this message]
2019-05-22 12:24 ` Leah Neukirchen
2019-05-22 16:56   ` attila

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=2KMER8ALDHL5P.2W76F2CU2HZ76@stalphonsos.com \
    --to=attila@stalphonsos.com \
    --cc=mblaze@googlegroups.com \
    --subject='Re: patch to mcom to make using msmtp easier w/multiple identities' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mblaze/

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 NNTP newsgroup(s).