[tin 1.7.x] allow "<>" as From:?

Urs Janßen <[email protected]>
Newsgroups gmane.network.tin.devel
Organization tin.org
Message-ID <[email protected]>
below is a patch from Ralf Doebelitz which allows "<>" as
from-address (I have added the code in post.c to disallow empty
Message-IDs). Im uncertain if we should enable the feature as the
gnksa-checker might be used elsewhere in the code where it should
reject an empty address (like in the Message-ID case where I've
fixed this (I did not add such a check to post.c:build_messageid()
as it's very unlikely that a system has no hostname/fqdn and even if
we hit that case the other test will catch this right before
posting)). comments?

--- misc.c	2005-05-04 11:46:33.000000000 +0200
+++ misc.c	2005-05-12 14:55:09.000000000 +0200
@@ -3397,7 +3397,15 @@
 		}
 	}
 
+	/*
+	 * if we allow <> as From: we must disallow <> as Mesage-ID,
+	 * see code in post.c:check_article_to_be_posted()
+	 */
+#if 1
+	if (!strchr(address, '@') && *address) /* check for From: without an @ but allow <> */
+#else
 	if (!strchr(address, '@')) /* check for From: without an @ */
+#endif /* 1 */
 		return GNKSA_ATSIGN_MISSING;
 
 	/* split successful */
--- post.c	2005-05-04 11:46:33.000000000 +0200
+++ post.c	2005-05-12 14:53:31.000000000 +0200
@@ -907,8 +907,17 @@
 		}
 
 		if (cp - line == 10 && !strncasecmp(line, "Message-ID", 10)) {
+#if 1 /* see comment about "<>" in misc.c:gnksa_split_from() */
+			char addr[HEADER_LEN], name[HEADER_LEN];
+			int type;
+
+			i = gnksa_check_from(cp + 1);
+			gnksa_split_from(cp + 1, addr, name, &type);
+			if (((GNKSA_OK != i) && (GNKSA_LOCALPART_MISSING > i)) || !*addr) {
+#else
 			i = gnksa_check_from(cp + 1);
 			if ((GNKSA_OK != i) && (GNKSA_LOCALPART_MISSING > i)) {
+#endif /* 1 */
 				setup_check_article_screen(&init);
 				StartInverse();
 				my_fprintf(stderr, _(txt_error_bad_msgidfqdn), i);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.