diff src/configfile.c @ 494:372f8b55506e noffle

[svn] Apply patch from Jan De Luyck. Add new option 'add-messageid-if-missing', which optionally postpones adding a message ID to the upstream server. If this is done, post-locally must be off. This is to deal with an upstream server troubling Jan. It usually (but not always) rejects posts with a Noffle message ID. I have changed Jan's original option of 'add-message-id-if-missing' for consistency with 'replace-messageid' and added the manual page entry. See SourceForge feature request 1513395.
author bears
date Wed, 12 Jul 2006 20:26:41 +0100
parents bcd7f11b1504
children 614a3177b15c
line wrap: on
line diff
--- a/src/configfile.c	Sun Apr 16 07:20:58 2006 +0100
+++ b/src/configfile.c	Wed Jul 12 20:26:41 2006 +0100
@@ -6,7 +6,7 @@
     SPOOLDIR
     VERSION
 
-  $Id: configfile.c 620 2003-11-29 23:42:33Z bears $
+  $Id: configfile.c 645 2006-07-12 19:26:41Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -99,6 +99,7 @@
     Str organization;
     Str noffleUser;
     Str noffleGroup;
+    Bool addMsgIdIfMissing;
 } config =
 {
     SPOOLDIR, /* spoolDir */
@@ -132,7 +133,8 @@
     "",       /* fromDomain */
     "",       /* organization */
     "news",   /* user Noffle runs as */
-    "news"    /* group Noffle runs as */
+    "news",   /* group Noffle runs as */
+    TRUE      /* addMsgIdIfMissing */
 };
 
 const char * Cfg_spoolDir( void ) { return config.spoolDir; }
@@ -159,6 +161,7 @@
 const char * Cfg_organization( void ) { return config.organization; }
 const char * Cfg_noffleUser( void ) { return config.noffleUser; }
 const char * Cfg_noffleGroup( void ) { return config.noffleGroup; }
+Bool Cfg_addMsgIdIfMissing( void ) { return config.addMsgIdIfMissing; }
 
 void Cfg_setClientAuth( Bool needsAuth )
 {
@@ -965,6 +968,8 @@
             getStr( config.hostnameMsgId, line );
         else if ( strcmp( "post-locally", name ) == 0 )
             getBool( &config.postLocal, p );
+	else if ( strcmp( "add-messageid-if-missing", name ) == 0 )
+            getBool( &config.addMsgIdIfMissing, p );
 #if USE_AUTH
 	/*
 	 * Don't recognise this unless we have some sort of auth
@@ -1017,4 +1022,7 @@
     fclose( f );
     if ( ! config.numServ )
         Log_fatal( "Config file contains no server" );
+
+    if ( config.postLocal && ! config.addMsgIdIfMissing )
+        Log_fatal ( "Local posting without adding missing Message-ID's is impossible. ");
 }