aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/inject_emails.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/inject_emails.sh b/tests/inject_emails.sh
new file mode 100755
index 0000000..1b1f5c7
--- /dev/null
+++ b/tests/inject_emails.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+cd $(dirname $0)
+
+function mail_lmtp_session (
+ echo -e "LHLO localhost\r"
+ for mail in $(find emails -name '*.eml'); do
+ echo -e "MAIL FROM: <alex@adnab.me>\r"
+ echo -e "RCPT TO: <lx@staging.deuxfleurs.org>\r"
+ echo -e "DATA\r"
+ cat $mail
+ echo -e "\r"
+ echo -e ".\r"
+ done
+ echo -e "QUIT\r"
+)
+
+mail_lmtp_session | tee >(nc localhost 12024)