smtptest/testmail

19 lines
463 B
Plaintext
Raw Permalink Normal View History

2023-04-25 11:32:24 +00:00
#!/bin/sh
[ -z "$1" ] && echo "testmail [user@email]" && exit 1
SENDTO=deon@dege.au
FROMUSER=$1
TMPFILE=/tmp/testmail.$$
echo "To: check-auth-${SENDTO/@/=}@verifier.port25.com" > ${TMPFILE}
echo "Cc: ${SENDTO}" >> ${TMPFILE}
echo "From: $1" >> ${TMPFILE}
echo "Date: `date --rfc-2822`" >> ${TMPFILE}
echo "Subject: Test Message" >> ${TMPFILE}
echo "This is a test message" >> ${TMPFILE}
echo "--- done" >> ${TMPFILE}
cat ${TMPFILE} | ssmtp -t -f ${FROMUSER}