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


A.4 Using gnutls-cli as connector

GNU TLS is a library implementing the TLS protocol; we can use it to establish encrypted and authenticated connections to a remote host. The SMTP protocol has extensions to allow usage of a TLS layer.

A GNU TLS installation comes with a command line test program, gnutls-cli, 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.

When handling an encrypted connection we have to know in advance how the remote SMTP server behaves. Let’s see first the simpler example, using the a human driven interactive session; then we will describe a more complex interaction.

Notice that gnutls-cli 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.