From 25ef7dd0cf27f4341161eb386d6388b4649a6100 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 26 Aug 2023 03:08:21 +0300 Subject: smail: Add ‘smail’ for simple mail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/smail | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .local/bin/smail diff --git a/.local/bin/smail b/.local/bin/smail new file mode 100755 index 0000000..a51476a --- /dev/null +++ b/.local/bin/smail @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +tmp=`mktemp` +trap "rm -f $tmp" EXIT + +cat - >$tmp +addr="`mhdr -h from $tmp | sed -E '/.*<.*>$/s/.*<(.*)>$/\1/'`" +mbox="$MAILDIR/$addr/Sent" + +msmtp -t --read-envelope-from <$tmp \ + && { + mgenmid \ + | sed 's/^/Message-Id: /' \ + | cat - $tmp \ + | mmime \ + | mdeliver -cv "$mbox" \ + | xargs mflag -S >/dev/null + } -- cgit v1.2.3