- http://www.opensquad.com/blog/testing-imap-and-smtp-authentication-with-telnet/
- https://noknow.info/it/postfix/solved_ssl_routines_renegotiate?lang=en
- Create base64 string of username and password:
# With the base64 binary
echo echo -ne '\0login\0password' | base64
ZWNobyAtbmUgXDBsb2dpblwwcGFzc3dvcmQK
# Or use Openssl
echo echo -ne '\0login\0password' | openssl base64
ZWNobyAtbmUgXDBsb2dpblwwcGFzc3dvcmQK
# Or use Perl
perl -MMIME::Base64 -e 'print encode_base64("\0login\0password")'
ZWNobyAtbmUgXDBsb2dpblwwcGFzc3dvcmQK
- Connect to SMTP server using openssl:
openssl s_client -starttls smtp -connect smtp.yourserver.com 587
- Initiate communication:
EHLO smtp.yourserver.com
- Authenticate using the base64 string:
AUTH PLAIN ZWNobyAtbmUgXDBsb2dpblwwcGFzc3dvcmQK
- Send out your email:
mail from:<[email protected]>
rcpt to:<[email protected]>
data
Subject: Test
Email content lorem ipsum.
.
If you get an SSL_renegotiate:wrong ssl version
error, that's because an uppercase R is recognized as TLS renegotiation command. The solution is to use lowercase command (e.g., rcpt instead of RCPT).