--- check_smtp.c.orig 2007-03-27 10:20:06.000000000 -0400 +++ check_smtp.c 2007-03-27 10:20:58.000000000 -0400 @@ -190,9 +190,9 @@ printf(_("gethostname() failed!\n")); return STATE_CRITICAL; } - } else { - helocmd = localhostname; } + helocmd = localhostname; + if(use_ehlo) asprintf (&helocmd, "%s%s%s", SMTP_EHLO, helocmd, "\r\n"); else