Next: , Previous: , Up: sendmail   [Contents][Index]


A.5 Using openssl as connector

OpenSSL is a library implementing the SSL/TLS protocol; we can use it to establish encrypted and authenticated connections to a remote host.

An OpenSSL installation comes with a command line test program, openssl, that can establish an encrypted connection. We use this command as the “connector” modeled in Send email through a process in background. It has a manual page, which we may want to read.

Here we see how we can use the openssl program in place of the gnutls-cli program described in Using gnutls-cli as connector. The two methods have a lot in common (the SMTP protocol is the same), we only have to understand the command line of the program.

Notice that openssl has a -crlf option that will cause all the lines sent to the server to be terminated by a carriage return/line feed sequence (\r\n or \x0d\x0a). If we write a script that terminates by itself the lines with this sequence, for example:

printf 'ehlo localhost.localdomain\r\n'

we must avoid this option, else SMTP protocol violation errors may occur. However, if we try a hand–driven interactive session, we want to use this option to send protocol–compliant lines.


Next: , Previous: , Up: sendmail   [Contents][Index]

This document describes version 3.0.0-devel.0 of Marcos Bash Functions Library.