Blame SOURCES/mailx-12.5-empty-from.patch

9770e7
diff -uprN nail/sendout.c nail-patched/sendout.c
9770e7
--- nail/sendout.c	2015-07-16 14:15:22.864905226 +0200
9770e7
+++ nail-patched/sendout.c	2015-07-17 09:41:06.778677181 +0200
9770e7
@@ -966,6 +966,19 @@ mail1(struct header *hp, int printheader
9770e7
 		return STOP;
9770e7
 	}
9770e7
 #endif
9770e7
+
9770e7
+	/*
9770e7
+	 * Variable "from" is set but empty, let user know
9770e7
+	 * that something is wrong.
9770e7
+	 */
9770e7
+	if ((cp = value("from")) != NULL && !*cp) {
9770e7
+		fprintf(stderr, "From address is empty. ");
9770e7
+		fprintf(stderr, "Check your mail config ");
9770e7
+		fprintf(stderr, "file for typos. E.g. no ");
9770e7
+		fprintf(stderr, "whitespace after set from=");
9770e7
+		fprintf(stderr, "\n");
9770e7
+	}
9770e7
+
9770e7
 	if ((cp = value("autocc")) != NULL && *cp)
9770e7
 		hp->h_cc = cat(hp->h_cc, checkaddrs(sextract(cp, GCC|GFULL)));
9770e7
 	if ((cp = value("autobcc")) != NULL && *cp)
9770e7
diff -uprN nail/smtp.c nail-patched/smtp.c
9770e7
--- nail/smtp.c	2015-07-16 14:15:17.626914449 +0200
9770e7
+++ nail-patched/smtp.c	2015-07-17 09:17:43.412730513 +0200
9770e7
@@ -135,7 +135,7 @@ myaddrs(struct header *hp)
9770e7
 		if (hp->h_from->n_name)
9770e7
 			return savestr(hp->h_from->n_name);
9770e7
 	}
9770e7
-	if ((cp = value("from")) != NULL)
9770e7
+	if ((cp = value("from")) != NULL && *cp)
9770e7
 		return cp;
9770e7
 	/*
9770e7
 	 * When invoking sendmail directly, it's its task
9770e7
@@ -177,6 +177,9 @@ smtp_auth_var(const char *type, const ch
9770e7
 	char	*var, *cp;
9770e7
 	int	len;
9770e7
 
9770e7
+	if (type == NULL || addr == NULL)
9770e7
+		return NULL;
9770e7
+
9770e7
 	var = ac_alloc(len = strlen(type) + strlen(addr) + 7);
9770e7
 	snprintf(var, len, "smtp-auth%s-%s", type, addr);
9770e7
 	if ((cp = value(var)) != NULL)