+ echo "test body" | m mail -s "test mail from $HOSTNAME, $_seq" "${@:-root@localhost}"
+ # for testing to send from an external address, you can do for example
+ # -aFrom:ian@iank.bid web-6fnbs@mail-tester.com
+ # note in exim, you can retry a deferred message
+ # s exim -M MSG_ID
+ # MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN
+}
+
+# use -eW to actually modify mailbox
+testsievelist() {
+ sieve-filter ~/sieve/main.sieve "$@" >/a/tmp/slog 2> >(tail) && sed -rn '/^Performed actions:/{n;n;p}' /a/tmp/slog | sort -u
+}
+
+
+testsieve() {
+ sieve-filter ~/sieve/main.sieve "$@"
+}
+
+testexim() {
+ # testmail above calls sendmail, which is a link to exim/postfix.
+ # it's docs don't say a way of adding an argument
+ # to sendmail to turn on debug output. We could make a wrapper, but
+ # that is a pain. Exim debug args are documented here:
+ # http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
+ #
+# http://www.exim.org/exim-html-current/doc/html/spec_html/ch-building_and_installing_exim.html
+# note, for exim daemon, you can turn on debug options by
+ # adding -d, etc to COMMONOPTIONS in
+ # /etc/default/exim4
+ # for testing external mail, you need the to address as final cmdline arg
+ exim -d+tls -t <<'EOF'
+From: root@frodo.lan
+To: ian@mail.iankelling.org
+Subject: Testing Exim
+
+This is a test message.
+EOF