If HAVE_UNAME, it seems that session->localhost will be the local host name without the domain name on the end. This causes grumpiness with any postfix installation where reject_non_fqdn_helo_hostname is configured, and maybe in other situations also. It seems from RFC5321 that the EHLO should be fully-qualified (or an IP address). Is there any chance that do_session could read /etc/mailname for the EHLO domain name? That'd let users choose what to send without having to re-compile libESMTP. Cheers!