summarylogtreecommitdiffstats
path: root/msmtp-flush-mail
blob: b365586ea2e425791d59e6e8120af089d5d0e119 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash -e
shopt -s extglob

MSMTP_OPT="--read-envelope-from \
		--logfile -"

for i in $(ls -tr $1)
do
	/usr/bin/msmtp ${MSMTP_OPT} ${EXTRA_OPT} $(< "$1/$i/opt") < "$1/$i/mail"
	rm -r $1/$i
done