comparison 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
comparison
equal deleted inserted replaced
493:4d3a1597813a 494:372f8b55506e
4 The following macros must be set, when compiling this file: 4 The following macros must be set, when compiling this file:
5 CONFIGFILE 5 CONFIGFILE
6 SPOOLDIR 6 SPOOLDIR
7 VERSION 7 VERSION
8 8
9 $Id: configfile.c 620 2003-11-29 23:42:33Z bears $ 9 $Id: configfile.c 645 2006-07-12 19:26:41Z bears $
10 */ 10 */
11 11
12 #if HAVE_CONFIG_H 12 #if HAVE_CONFIG_H
13 #include <config.h> 13 #include <config.h>
14 #endif 14 #endif
97 Str pathHeader; 97 Str pathHeader;
98 Str fromDomain; 98 Str fromDomain;
99 Str organization; 99 Str organization;
100 Str noffleUser; 100 Str noffleUser;
101 Str noffleGroup; 101 Str noffleGroup;
102 Bool addMsgIdIfMissing;
102 } config = 103 } config =
103 { 104 {
104 SPOOLDIR, /* spoolDir */ 105 SPOOLDIR, /* spoolDir */
105 VERSION, /* version */ 106 VERSION, /* version */
106 300, /* maxFetch */ 107 300, /* maxFetch */
130 NULL, /* autoSubscribeMode */ 131 NULL, /* autoSubscribeMode */
131 "", /* pathHeader */ 132 "", /* pathHeader */
132 "", /* fromDomain */ 133 "", /* fromDomain */
133 "", /* organization */ 134 "", /* organization */
134 "news", /* user Noffle runs as */ 135 "news", /* user Noffle runs as */
135 "news" /* group Noffle runs as */ 136 "news", /* group Noffle runs as */
137 TRUE /* addMsgIdIfMissing */
136 }; 138 };
137 139
138 const char * Cfg_spoolDir( void ) { return config.spoolDir; } 140 const char * Cfg_spoolDir( void ) { return config.spoolDir; }
139 const char * Cfg_version( void ) { return config.version; } 141 const char * Cfg_version( void ) { return config.version; }
140 142
157 const char * Cfg_pathHeader( void ) { return config.pathHeader; } 159 const char * Cfg_pathHeader( void ) { return config.pathHeader; }
158 const char * Cfg_fromDomain( void ) { return config.fromDomain; } 160 const char * Cfg_fromDomain( void ) { return config.fromDomain; }
159 const char * Cfg_organization( void ) { return config.organization; } 161 const char * Cfg_organization( void ) { return config.organization; }
160 const char * Cfg_noffleUser( void ) { return config.noffleUser; } 162 const char * Cfg_noffleUser( void ) { return config.noffleUser; }
161 const char * Cfg_noffleGroup( void ) { return config.noffleGroup; } 163 const char * Cfg_noffleGroup( void ) { return config.noffleGroup; }
164 Bool Cfg_addMsgIdIfMissing( void ) { return config.addMsgIdIfMissing; }
162 165
163 void Cfg_setClientAuth( Bool needsAuth ) 166 void Cfg_setClientAuth( Bool needsAuth )
164 { 167 {
165 config.clientAuth = needsAuth; 168 config.clientAuth = needsAuth;
166 } 169 }
963 else if ( strcmp( "hostname", name ) == 0 ) 966 else if ( strcmp( "hostname", name ) == 0 )
964 /* use line, do not change to lowercase */ 967 /* use line, do not change to lowercase */
965 getStr( config.hostnameMsgId, line ); 968 getStr( config.hostnameMsgId, line );
966 else if ( strcmp( "post-locally", name ) == 0 ) 969 else if ( strcmp( "post-locally", name ) == 0 )
967 getBool( &config.postLocal, p ); 970 getBool( &config.postLocal, p );
971 else if ( strcmp( "add-messageid-if-missing", name ) == 0 )
972 getBool( &config.addMsgIdIfMissing, p );
968 #if USE_AUTH 973 #if USE_AUTH
969 /* 974 /*
970 * Don't recognise this unless we have some sort of auth 975 * Don't recognise this unless we have some sort of auth
971 * built in. A small sanity check on the config. 976 * built in. A small sanity check on the config.
972 */ 977 */
1015 Log_err( "Unknown config option: %s", name ); 1020 Log_err( "Unknown config option: %s", name );
1016 } 1021 }
1017 fclose( f ); 1022 fclose( f );
1018 if ( ! config.numServ ) 1023 if ( ! config.numServ )
1019 Log_fatal( "Config file contains no server" ); 1024 Log_fatal( "Config file contains no server" );
1020 } 1025
1026 if ( config.postLocal && ! config.addMsgIdIfMissing )
1027 Log_fatal ( "Local posting without adding missing Message-ID's is impossible. ");
1028 }