From 1db33136b0e4176848e202281b4a054a7ed71533 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Tue, 6 Mar 2007 22:17:04 +0000 Subject: Fixed broken HELO cmd (Enrico Scholz - 1675279) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1630 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_smtp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index a7ba45a1..6987e172 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -179,7 +179,7 @@ main (int argc, char **argv) if (process_arguments (argc, argv) == ERROR) usage4 (_("Could not parse arguments")); - /* initialize the HELO command with the localhostname */ + /* If localhostname not set on command line, use gethostname to set */ if(! localhostname){ localhostname = malloc (HOST_MAX_BYTES); if(!localhostname){ @@ -190,13 +190,11 @@ main (int argc, char **argv) printf(_("gethostname() failed!\n")); return STATE_CRITICAL; } - } else { - helocmd = localhostname; } if(use_ehlo) - asprintf (&helocmd, "%s%s%s", SMTP_EHLO, helocmd, "\r\n"); + asprintf (&helocmd, "%s%s%s", SMTP_EHLO, localhostname, "\r\n"); else - asprintf (&helocmd, "%s%s%s", SMTP_HELO, helocmd, "\r\n"); + asprintf (&helocmd, "%s%s%s", SMTP_HELO, localhostname, "\r\n"); if (verbose) printf("HELOCMD: %s", helocmd); -- cgit v1.2.3-74-g34f1