Skip to content

Hacking-Lab/alpine-postfix-hl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

run postfix with smtp authentication (sasldb) in a docker container. with STARTLS and OpenDKIM support.

STARTTLS

Repository contains sample key and crt for postfix. Create your own keys with:

cd root/etc/postfix/certs
openssl req -newkey rsa:4096 -nodes -sha512 -x509 -days 3650 -nodes -out postfix.crt -keyout postfix.key

DKIM

Repository contains sample dkim with selector = jupiter._domainkey. Create your own keys with:

cd root/etc/opendkim/domainkeys/
opendkim-genkey -s jupiter -d hacking-lab.com

SMTP AUTH

Configure SMTP Users in your docker-compose.yml. The accounts will be created in the SASLDB.

    environment:
      TZ: Europe/Zurich
      # Uncomment to enable debugging messages:
      #LOGXI: '*'
      maildomain: hacking-lab.com
      smtp_user: ivan.buetler:EBp5CJNcykf7cgmb,no-reply:FIj8qVxZXINXjJOC

MAILDOMAIN

Use the ENV in the docker-compose.yml

TEST MAIL Port 25

STARTLS is not supported on port 25

./smtptest.py -v -n 25 -t -u ivan.buetler -p EBp5CJNcykf7cgmb <sender-mail> <recipient-mail> <hostname> 
./smtptest.py -v -n 25 -t -u no-reply -p FIj8qVxZXINXjJOC <sender-mail> <recipient-mail> <hostname> 

or

apt install swaks
swaks --to <recipient-mail> --from <sender-mail> --server localhost --port 25 

TEST MAIL Port 587

STARTLS is supported on port 587

./smtptest.py -v -n 587 -t -u ivan.buetler -p EBp5CJNcykf7cgmb <sender-mail> <recipient-mail> <hostname> 
./smtptest.py -v -n 587 -t -u no-reply -p FIj8qVxZXINXjJOC <sender-mail> <recipient-mail> <hostname> 

or

swaks --port 587 --tls \
--auth LOGIN --auth-user ivan.buetler \
--auth-password EBp5CJNcykf7cgmb \
--to <recipient-mail> \
--from <sender-mail> \
--server localhost

About

Alpine Postfix with SMTP AUTH, STARTTLS and DKIM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors