diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-12-06 20:58:18 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-12-06 20:58:47 +0100 |
commit | db7321af115a79b63267cb18889cbd334e8ca6e2 (patch) | |
tree | ec388295051ebc1f3d79bd3baf79b7f12f076cda /.local/bin/smail | |
parent | f2fde1570a04a654e2ed0c165d56feb29ddb25bf (diff) |
scripts: Move many a script from sh to andy
Diffstat (limited to '.local/bin/smail')
-rwxr-xr-x | .local/bin/smail | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/.local/bin/smail b/.local/bin/smail index fa1c887..7268307 100755 --- a/.local/bin/smail +++ b/.local/bin/smail @@ -1,20 +1,19 @@ -#!/bin/sh +#!/usr/local/bin/andy -set -e - -tmp=`mktemp` -trap "rm -f $tmp" EXIT +set tmp `mktemp +func sigexit { + rm -f $tmp +} cat >$tmp -addr="`mhdr -h from $tmp | sed -E '/.*<.*>$/s/.*<(.*)>$/\1/'`" -mbox="$MAILDIR/$addr/Sent" +set addr `mhdr -h from $tmp | sed -E '/.*<.*>$/s/.*<(.*)>$/\1/' +set mbox $MAILDIR/$addr/Sent -if msmtp -t --read-envelope-from <$tmp -then - mgenmid \ - | sed 's/^/Message-Id: /' \ - | cat - $tmp \ - | mmime \ - | mdeliver -cv "$mbox" \ +if msmtp -t --read-envelope-from <$tmp { + mgenmid + | sed 's/^/Message-Id: /' + | cat - $tmp + | mmime + | mdeliver -cv $mbox | xargs chronic mflag -S -fi +} |