In this post we detail how to use Swaks for testing emails over tls. This
post picks up where the manual page leaves off and more explicitly goes
over how to send a test email over tls. Swaks is a popular tool in penetration
testing circles, it is written in Perl and according to itโs github history it
was first published on December 12th 2001.
Installing
Swaks is available from most popular package managers for
installation.
With ubuntu or debian:
In a Dockerfile you can append it to the list of dependencies:
Note Swaks is not available in apk for alpine linux base images. I mention this because
alpine is a popular base image for docker containers.
Send email with tls 1.2
This is the heart of the post. To send an email using swaks and tls 1.2 do:
in my case we had to specify port 587 and a specific from address due to the security
preferences on the smtp server. Your mileage may vary.
More use
For completeness here is what I first tried. Running swaks by only specifying the credentials
swaks negotiated NTLM (windows NT Lan Manager (a weak protocol)).
OpenSSL
If for whatever reason you cannot install swaks (for example on alpine linux) you
can try the openssl command.
If you need help solving your business problems with
software read how to hire me.