summaryrefslogtreecommitdiff
path: root/.local/bin/smail
blob: 7268307db6c2f64477b7bcb166e1e93a83531d53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/local/bin/andy

set tmp `mktemp
func sigexit {
	rm -f $tmp
}

cat >$tmp
set addr `mhdr -h from $tmp | sed -E '/.*<.*>$/s/.*<(.*)>$/\1/'
set mbox $MAILDIR/$addr/Sent

if msmtp -t --read-envelope-from <$tmp {
	mgenmid
	| sed 's/^/Message-Id: /'
	| cat - $tmp
	| mmime
	| mdeliver -cv $mbox
	| xargs chronic mflag -S
}