summarylogtreecommitdiffstats
path: root/msmtp-flush-mail
diff options
context:
space:
mode:
authorMax Gautier2022-06-28 15:15:33 +0200
committerMax Gautier2022-06-28 15:15:33 +0200
commita877d2c6ab14b332dd23df424cbc8776a09f1cfa (patch)
tree9605cbb4fb4a875758710d477036670906af1a3e /msmtp-flush-mail
downloadaur-msmtpq-systemd.tar.gz
First commit
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