Parcourir la source

check_smtp: Remove a comment regarding MAIL FROM

Earlier versions of check_smtp generated an (invalid) "MAIL FROM"
command without arguments by default.  These days, a "MAIL FROM" command
is only sent if the --from option is specified.

This commit removes a comment which explains the old behaviour, and it
updates a variable name accordingly.
Holger Weiss il y a 13 ans
Parent
commit
b57aeb1e5f
1 fichiers modifiés avec 4 ajouts et 15 suppressions
  1. 4 15
      plugins/check_smtp.c

+ 4 - 15
plugins/check_smtp.c

@@ -87,9 +87,7 @@ int errcode, excode;
 int server_port = SMTP_PORT;
 int server_port = SMTP_PORT;
 char *server_address = NULL;
 char *server_address = NULL;
 char *server_expect = NULL;
 char *server_expect = NULL;
-int smtp_use_dummycmd = 0;
-char *mail_command = NULL;
-char *from_arg = NULL;
+int send_mail_from=0;
 int ncommands=0;
 int ncommands=0;
 int command_size=0;
 int command_size=0;
 int nresponses=0;
 int nresponses=0;
@@ -166,7 +164,7 @@ main (int argc, char **argv)
 	/* initialize the MAIL command with optional FROM command  */
 	/* initialize the MAIL command with optional FROM command  */
 	xasprintf (&cmd_str, "%sFROM:<%s>%s", mail_command, from_arg, "\r\n");
 	xasprintf (&cmd_str, "%sFROM:<%s>%s", mail_command, from_arg, "\r\n");
 
 
-	if (verbose && smtp_use_dummycmd)
+	if (verbose && send_mail_from)
 		printf ("FROM CMD: %s", cmd_str);
 		printf ("FROM CMD: %s", cmd_str);
 
 
 	/* initialize alarm signal handling */
 	/* initialize alarm signal handling */
@@ -283,16 +281,7 @@ main (int argc, char **argv)
 		}
 		}
 #endif
 #endif
 
 
-		/* sendmail will syslog a "NOQUEUE" error if session does not attempt
-		 * to do something useful. This can be prevented by giving a command
-		 * even if syntax is illegal (MAIL requires a FROM:<...> argument)
-		 *
-		 * According to rfc821 you can include a null reversepath in the from command
-		 * - but a log message is generated on the smtp server.
-		 *
-		 * Use the -f option to provide a FROM address
-		 */
-		if (smtp_use_dummycmd) {
+		if (send_mail_from) {
 		  my_send(cmd_str, strlen(cmd_str));
 		  my_send(cmd_str, strlen(cmd_str));
 		  if (recvlines(buffer, MAX_INPUT_BUFFER) >= 1 && verbose)
 		  if (recvlines(buffer, MAX_INPUT_BUFFER) >= 1 && verbose)
 		    printf("%s", buffer);
 		    printf("%s", buffer);
@@ -521,7 +510,7 @@ process_arguments (int argc, char **argv)
 		case 'f':									/* from argument */
 		case 'f':									/* from argument */
 			from_arg = optarg + strspn(optarg, "<");
 			from_arg = optarg + strspn(optarg, "<");
 			from_arg = strndup(from_arg, strcspn(from_arg, ">"));
 			from_arg = strndup(from_arg, strcspn(from_arg, ">"));
-			smtp_use_dummycmd = 1;
+			send_mail_from = 1;
 			break;
 			break;
 		case 'A':
 		case 'A':
 			authtype = optarg;
 			authtype = optarg;