aboutsummaryrefslogtreecommitdiff
path: root/tests/instrumentation/inject_emails.sh
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-02 22:44:29 +0000
committerQuentin <quentin@dufour.io>2024-01-02 22:44:29 +0000
commitb9a0c1e6eced036eb71e8221a4f236f72832fec2 (patch)
treec498a7a2a5833f2c6f27d4ba97894747f9d454c0 /tests/instrumentation/inject_emails.sh
parent6ff3c6f71efd802da422a371e6168ae528fb2ddc (diff)
parentc9a33c080d39d4a2b269e3c8f166a708b6606da5 (diff)
downloadaerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.tar.gz
aerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.zip
Merge pull request 'Implement imap-flow' (#34) from refactor/imap-flow into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/34
Diffstat (limited to 'tests/instrumentation/inject_emails.sh')
-rwxr-xr-xtests/instrumentation/inject_emails.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/instrumentation/inject_emails.sh b/tests/instrumentation/inject_emails.sh
new file mode 100755
index 0000000..a021170
--- /dev/null
+++ b/tests/instrumentation/inject_emails.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+SCRIPT=$0
+USER=$1
+SUBFOLDER=$2
+cd $(dirname $SCRIPT)
+
+function mail_lmtp_session (
+ echo -e "LHLO localhost\r"
+ for mail in $(find emails/$SUBFOLDER -name '*.eml' ); do
+ echo -e "MAIL FROM: <alex@adnab.me>\r"
+ echo -e "RCPT TO: $USER\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)