Plugin Version (-V output): 1.4.16
Plugin Name: check_smtp
Plugin Commandline showing issues: check_smtp -H [postfix-MTA-IP] -F nagios.[domain] -S -D 5,2 -v
Operating System: CentOS
Compiler: (from repos)
check_smtp -D executes the "if ( check_cert )" branch, which calls my_close(), which closes the connection. No SMTP QUIT command is being sent, which makes the (postfix) MTA log "lost connection after EHLO" warning messages. Please include an smtp_quit() somewhere along this code path.
(I'm not submitting a patch myself because I don't know offhand whether the smtp_quit() should go into the "if ( check_cert )" branch alone, or become part of my_close(), which also handles two EHLO error cases.)