Script to quickly test email submission via SMTP encrypted with STARTTLS.
The SMTP server (Host), sender (From) and receiver (To) are specified as command line arguments, the password is requested after running the script.
The script then runs the openssl
program and sends the commands required to send an email.
Note: Only works with STARTTLS (default port 587), not SSL (default port 465). Tested with gmx.net, probably works with some other providers, too.
Make sure you have openssl and expect installed.
The minimum required version for base64 support in expect is 8.6
Ubuntu based Linux:
sudo apt update
sudo apt install openssl expect
- Download check-smtp.tcl
- Make it executable
- Run it with
./check-smtp.tcl <HOST:PORT> <FROM> <TO>
# Download
curl -O https://gist.githubusercontent.com/RafaelKr/37fe66535bce3d3ce15ff5bc416e9956/raw/02449b1a36dafccba73a1a339e341cd483fdfeef/check-smtp.tcl
# Make it executable
chmod +x check-smtp.tcl
# Use it!
./check-smtp.tcl mail.gmx.net:587 sender-address@gmx.net receiver-address@example.org