mblaze, a Maildir-focused command line mail client
 help / color / 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
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 index

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 \
    /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

mblaze, a Maildir-focused command line mail client

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mblaze

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.devel.mblaze


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git