mblaze, a Maildir-focused command line mail client
 help / color / mirror / code / Atom feed
* patch to mcom to make using msmtp easier w/multiple identities
@ 2019-05-21 15:25 attila
  2019-05-22 12:24 ` Leah Neukirchen
  0 siblings, 1 reply; 3+ messages in thread
From: attila @ 2019-05-21 15:25 UTC (permalink / raw)
  To: mblaze

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch to mcom to make using msmtp easier w/multiple identities
  2019-05-21 15:25 patch to mcom to make using msmtp easier w/multiple identities attila
@ 2019-05-22 12:24 ` Leah Neukirchen
  2019-05-22 16:56   ` attila
  0 siblings, 1 reply; 3+ messages in thread
From: Leah Neukirchen @ 2019-05-22 12:24 UTC (permalink / raw)
  To: attila; +Cc: mblaze

attila <attila@stalphonsos.com> writes:

> 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.

Can't you use:

sendmail: /usr/local/bin/msmtp --read-envelope-from

-- 
Leah Neukirchen  <leah@vuxu.org>  http://leahneukirchen.org/

-- 
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/87mujesmm2.fsf%40vuxu.org.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch to mcom to make using msmtp easier w/multiple identities
  2019-05-22 12:24 ` Leah Neukirchen
@ 2019-05-22 16:56   ` attila
  0 siblings, 0 replies; 3+ messages in thread
From: attila @ 2019-05-22 16:56 UTC (permalink / raw)
  To: Leah Neukirchen; +Cc: mblaze

Leah Neukirchen <leah@vuxu.org> wrote:
> attila <attila@stalphonsos.com> writes:
> 
> > 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.
> 
> Can't you use:
> 
> sendmail: /usr/local/bin/msmtp --read-envelope-from

Yes, I can.  I clearly missed this option in my reading the msmtp man
page.  Thanks for pointing it out, sorry for the noise and thanks for a
great MUA.

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/35BFC42YZCLEL.20AEQY3K9VDAJ%40stalphonsos.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-22 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 15:25 patch to mcom to make using msmtp easier w/multiple identities attila
2019-05-22 12:24 ` Leah Neukirchen
2019-05-22 16:56   ` attila

Code repositories for project(s) associated with this public 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).