SWAKS on macOS
SWAKS is my favorite SMTP debugging tool.
A new SMTP server I’m building loses pipelining synchronization when connecting via TLS, and I’m sure the bug will be simple to spot if I can send some test messages in to it and watch the sequence of commands. SWAKS is perfect for that.
But … SWAKS has been broken on macOS for a while, at least if you want to
use STARTTLS. It’s written in perl, and it depends on the perl module
Net::SSLeay
. And Net::SSLeay
depends on openssl, and doesn’t build cleanly
using openssl as installed by homebrew cleanly. You can
persuade it to build by overriding the path it uses to find openssl, but the tests
fail for silly reasons like different whitespace in obscure functions that you
didn’t care about anyway.
Net::SSLeay
tests were fixed in January, at least in it’s git repo. Those changes
haven’t been pushed to CPAN yet, so version 1.94 - the latest version - doesn’t build cleanly.
If you’re on macOS, want to use SWAKS and have homebrew and XCode tools installed you can build everything fairly cleanly.
Install openssl and swaks using homebrew:
brew install openssl swaks
Clone a local copy of the Net::SSLeay
source tree:
git clone https://github.com/radiator-software/p5-net-ssleay.git
Configure, build, test and install Net::SSLeay
:
cd p5-net-ssleay
export OPENSSL_PREFIX=/opt/homebrew/opt/openssl@3.5
perl Makefile.pl
make
make test
sudo make install
And then swaks should be able to use STARTTLS.
Now, back to my pipelining problem…