Initial version
This commit is contained in:
commit
853768d9bc
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# NAME leenooks/smtptest
|
||||||
|
# VERSION latest
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
# Change to http respositories, so they we can cache the install packages
|
||||||
|
RUN if [ -n ${HTTP_PROXY} ] ; then sed -ie s'/https/http/' /etc/apk/repositories; fi
|
||||||
|
|
||||||
|
RUN apk add --no-cache ssmtp
|
||||||
|
RUN sed -i -e 's/^mailhub=mail$/mailhub=smtp/' -e "s/^hostname=/#hostname=/" -e 's/#FromLineOverride=YES/FromLineOverride=YES/' /etc/ssmtp/ssmtp.conf
|
||||||
|
|
||||||
|
COPY testmail /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["testmail"]
|
18
testmail
Executable file
18
testmail
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/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}
|
Loading…
Reference in New Issue
Block a user