Skip to content

Infrastructure for mails.wdes.eu

License

Notifications You must be signed in to change notification settings

wdes/mails.wdes.eu

Repository files navigation

Emails

Our Docker-Mailserver infra.

Nice tools to use to validate the infra

DANE (TSLA records)

Generate

Use https://ssl-tools.net/tlsa-generator

Our CA is https://ssl-tools.net/subjects/082e3ff9058cfe8a7c18bd13efdf1d1660707a6b Download PEM and put in the generator Use full cert and SHA2-256. SHA2-512 is not recommended by the mailhardener article. Since it is the CA use: DANE-TA: Trust Anchor Assertion. The values (0) PKIX-TA (1) PKIX-EE should not be used with SMTP.

Use PORT 25 !

Test the generated value:

  • openssl s_client -brief -dane_tlsa_domain mx1.mails.example.org -dane_tlsa_rrdata "2 0 1 21acc1dbd6944f9ac18c782cb5c328d6c2821c6b63731fa3b8987f5625de8a0d" -connect mx1.mails.example.org:465 <<< "Q"
  • Alter the hash to check that it fails.

TODO

Interesting documentations

Manage bans

docker exec -it xxxx-crowdsec-1 cscli decisions list
docker exec -it xxxx-crowdsec-1 cscli alerts remove --ip=x.x.x.x
docker exec -it xxxx-mailserver-1 fail2ban-client banned
docker exec -it xxxx-crowdsec-1 setup fail2ban unban x.x.x.x

Empty queue for an email

mailq | tail +2 | awk 'BEGIN { RS = "" } /postmaster@domain.intranet$/ { print $1 }' | tr -d '*!#' | postsuper -d -

Re-queue emails for an email

mailq | tail +2 | awk 'BEGIN { RS = "" } /postmaster@domain.intranet$/ { print $1 }' | tr -d '*!#' | postsuper -r -

Mails in queue

mailq | cut -d ' ' -f 1 | sort | uniq | wc -l

Inspect mail in queue

postcat -q 5E6E5800B9

Remove mail in queue

postsuper -d CA48B81E3C