# HG changeset patch
# User bears
# Date 1007897551 0
# Node ID bf290632d29e27a39a07a681cadbb5d0d6c5527f
# Parent  0eaf9399717052461c3dc17dfc1831fa87f871a5
[svn] * src/post.c: Always replace message ID in posted message if existing
  message ID fails Prt_isValidMsgId.
* noffle.conf.example,docs/noffle.conf.5,src/configfile.c: Change
  replace-messageid default from 'yes' to 'no'. These days bad message
  IDs from newsreaders shouldn't happen (or should be more easily fixable
  from the newsreader config), and replacing message IDs causes havoc if
  you're gatewaying mailing lists or similar.

diff -r 0eaf93997170 -r bf290632d29e ChangeLog
--- a/ChangeLog	Sun Dec 02 19:32:44 2001 +0000
+++ b/ChangeLog	Sun Dec 09 11:32:31 2001 +0000
@@ -1,3 +1,13 @@
+Sun Dec 9 2001 Jim Hague <jim.hague@acm.org>
+
+* src/post.c: Always replace message ID in posted message if existing
+  message ID fails Prt_isValidMsgId.
+* noffle.conf.example,docs/noffle.conf.5,src/configfile.c: Change
+  replace-messageid default from 'yes' to 'no'. These days bad message
+  IDs from newsreaders shouldn't happen (or should be more easily fixable
+  from the newsreader config), and replacing message IDs causes havoc if
+  you're gatewaying mailing lists or similar.
+
 Sun Dec 2 2001 Mirko Li� <mirko.liss@web.de>
 
 * src/protocol.c: Use pid and count to generate MsgIDs, not random number.
diff -r 0eaf93997170 -r bf290632d29e docs/noffle.conf.5
--- a/docs/noffle.conf.5	Sun Dec 02 19:32:44 2001 +0000
+++ b/docs/noffle.conf.5	Sun Dec 09 11:32:31 2001 +0000
@@ -1,5 +1,5 @@
 .TH noffle.conf 5
-.\" $Id: noffle.conf.5 331 2001-11-22 12:04:45Z mirkol $
+.\" $Id: noffle.conf.5 341 2001-12-09 11:32:31Z bears $
 
 .SH NAME
 noffle.conf \- Configuration file for NOFFLE news server
@@ -208,20 +208,24 @@
 Place articles posted to external servers in the local aticle database
 immediately. Some servers may rewrite Message-IDs, which will cause
 duplicate postings of this option is enabled. Also, if for some reason
-the post to the remote server fails, the article still exist in the local
+the post to the remote server fails, the article still exists in the local
 database, which may be a source of some confusion.
 .br
 Default: no
 
 .TP
 .B replace-messageid yes|no
-Replace Message-ID of posted articles by a Message-ID generated by
-NOFFLE. Some news readers generate Message-IDs that are not accepted by
-some servers. For generating Message-IDs, the domain name of your system should
-be a valid domain name. If you are in a local domain, set it to your
-provider's domain name.
+Always replace the Message-ID of a posted article with a Message-ID
+generated by NOFFLE. NOFFLE will always add a Message-ID if none is
+present, or replace a Message-ID that does not meet the basic
+formatting and content requirements for a Message-ID.  However, some
+news readers may generate Message-IDs that are not accepted by some
+servers (for example the server may insist the Message-ID domain is
+part of the server domain) or may not always be unique. In either of
+these cases you may prefer to have NOFFLE always replace the
+Message-ID.
 .br
-Default: yes
+Default: no
 
 .TP
 .B hostname <fully.qualified.domain.name>
diff -r 0eaf93997170 -r bf290632d29e noffle.conf.example
--- a/noffle.conf.example	Sun Dec 02 19:32:44 2001 +0000
+++ b/noffle.conf.example	Sun Dec 09 11:32:31 2001 +0000
@@ -61,12 +61,12 @@
 # If the hostname option is unused, it is replaced by the fully qualified
 # domain name of your system.
 
-replace-messageid yes
+replace-messageid no
 #hostname UserId-XXXXX_newsserver
 
 # Post articles to remote groups into the local database immediately
 # on receipt of article.
-# post-locally no
+#post-locally no
 
 # Set the default expire period in days
 default-expire 14
diff -r 0eaf93997170 -r bf290632d29e src/configfile.c
--- a/src/configfile.c	Sun Dec 02 19:32:44 2001 +0000
+++ b/src/configfile.c	Sun Dec 09 11:32:31 2001 +0000
@@ -6,7 +6,7 @@
     SPOOLDIR
     VERSION
 
-  $Id: configfile.c 331 2001-11-22 12:04:45Z mirkol $
+  $Id: configfile.c 341 2001-12-09 11:32:31Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -105,7 +105,7 @@
     FALSE,    /* autoSubscribe */
     FALSE,    /* autoUnsubscribe */
     TRUE,     /* infoAlways */
-    TRUE,     /* replaceMsgId */
+    FALSE,    /* replaceMsgId */
     "",       /* hostnameMsgId */
     FALSE,    /* postLocal */
     "over",   /* defaultAutoSubscribeMode */
diff -r 0eaf93997170 -r bf290632d29e src/post.c
--- a/src/post.c	Sun Dec 02 19:32:44 2001 +0000
+++ b/src/post.c	Sun Dec 09 11:32:31 2001 +0000
@@ -1,7 +1,7 @@
 /*
   post.c
 
-  $Id: post.c 316 2001-10-31 11:44:53Z bears $
+  $Id: post.c 341 2001-12-09 11:32:31Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -290,18 +290,18 @@
     DynStr_appLn( s, article.over.date );
 
     /* Ensure Message ID is present and valid */
-    if ( Cfg_replaceMsgId() )
+    if ( article.over.msgId[ 0 ] == '\0' )
+    {
+	Prt_genMsgId( article.over.msgId, article.over.from, "NOFFLE" );
+	Log_inf( "Adding missing Message-ID '%s'", article.over.msgId );
+    }
+    else if ( ! Prt_isValidMsgId( article.over.msgId ) || Cfg_replaceMsgId() )
     {
 	Prt_genMsgId( article.over.msgId, article.over.from, "NOFFLE" );
 	Log_dbg( LOG_DBG_POST,
 		 "Replacing Message-ID with '%s'",
 		 article.over.msgId );
     }
-    else if ( article.over.msgId[ 0 ] == '\0' )
-    {
-	Prt_genMsgId( article.over.msgId, article.over.from, "NOFFLE" );
-	Log_inf( "Adding missing Message-ID '%s'", article.over.msgId );
-    }
     DynStr_app( s, "Message-ID: " );
     DynStr_appLn( s, article.over.msgId );