about summary refs log tree commit diff
path: root/mcom
diff options
context:
space:
mode:
authorStacy Harper <contact@stacyharper.net>2021-11-05 16:42:14 +0100
committerLeah Neukirchen <leah@vuxu.org>2021-11-08 17:11:25 +0100
commite1e5bfe5ff6009b3937d35817ae08716d71a56b5 (patch)
tree8b6277efaa2b96234cf3475cc436f9acfc89ee3a /mcom
parente44aaad66e0465a667f0f0d0e7e9f90b186035ff (diff)
downloadmblaze-e1e5bfe5ff6009b3937d35817ae08716d71a56b5.tar.gz
mblaze-e1e5bfe5ff6009b3937d35817ae08716d71a56b5.tar.xz
mblaze-e1e5bfe5ff6009b3937d35817ae08716d71a56b5.zip
mcom: take Delivered-To into account for choosing From address
I just received a mail coming from a Google Group mail list and it had
the group email as To. So my reply used the default configured mail as
from and not the correct one.

Googles mails provide the target email as Delivered-To. This patch add
this check before the To to prevent this error.

Closes: #217 [via git-merge-pr]
Diffstat (limited to 'mcom')
-rwxr-xr-xmcom2
1 files changed, 1 insertions, 1 deletions
diff --git a/mcom b/mcom
index f1657ad..d60070e 100755
--- a/mcom
+++ b/mcom
@@ -368,7 +368,7 @@ fi
 		printf 'Subject: Re: %s\n' "$(COLUMNS=10000 mscan -f '%S' "$1")"
 		if ! printf '%s\n' "$hdrs" | awk '{ print }' |
 		     mhdr -h from: - >/dev/null; then
-			addr=$(maddr -a -h to:cc:bcc: "$1" | replyfrom | head -n1)
+			addr=$(maddr -a -h delivered-to:to:cc:bcc: "$1" | replyfrom | head -n1)
 			[ -n "$addr" ] && from=$(maddr -h reply-from "$MBLAZE/profile" | grep -Fi "<$addr>" | head -n1)
 			[ -n "$addr" ] && [ -z "$from" ] && from=$(maddr -h alternate-mailboxes "$MBLAZE/profile" | grep -Fi "<$addr>" | head -n1)
 			[ -z "$from" ] && from=$(mhdr -h local-mailbox "$MBLAZE/profile")