blob: a0211702de1d478472c14ec3d7f47059c87ddf0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
|