From db7321af115a79b63267cb18889cbd334e8ca6e2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 6 Dec 2023 20:58:18 +0100 Subject: scripts: Move many a script from sh to andy --- .local/bin/smail | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to '.local/bin/smail') 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 +} -- cgit v1.2.3