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…

Related Posts

Can you STARTTLS?

Email supports TLS (Transport Layer Security), what we used to call SSL.

Read More

Life of an Email

I’m repeating the presentation I gave at M3AAWG in London for the Certified Senders Alliance.

It’s all about how to send an email by hand, and how knowing the mechanics of how an email is sent can help us diagnose email delivery issues.

We’re starting in about five hours from when I post this.

Register at https://register.gotowebinar.com/register/2268789893122531343

Read More

Don’t trust Gmail’s Show Original

It’s not always easy to know what the actual headers and body of an email as sent look like. For a long time accepted wisdom was that you could send a copy to your gmail account, and use the Show Original menu option to, well, see the original message as raw text.

Read More