summarylogtreecommitdiffstats
path: root/msmtp-flush-mail
diff options
context:
space:
mode:
Diffstat (limited to 'msmtp-flush-mail')
-rwxr-xr-xmsmtp-flush-mail11
1 files changed, 11 insertions, 0 deletions
diff --git a/msmtp-flush-mail b/msmtp-flush-mail
new file mode 100755
index 000000000000..b365586ea2e4
--- /dev/null
+++ b/msmtp-flush-mail
@@ -0,0 +1,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