# HG changeset patch # User bears # Date 961878481 -3600 # Node ID 6f681d41734c7ef83e276a747f60ea129fe1d809 # Parent d23f038454d4ea01d14897c0ae06d5736d04904e [svn] path-header added. diff -r d23f038454d4 -r 6f681d41734c docs/noffle.conf.5 --- a/docs/noffle.conf.5 Sat Jun 24 21:20:01 2000 +0100 +++ b/docs/noffle.conf.5 Sat Jun 24 21:28:01 2000 +0100 @@ -1,5 +1,5 @@ .TH noffle.conf 5 -.\" $Id: noffle.conf.5 146 2000-06-13 06:41:08Z bears $ +.\" $Id: noffle.conf.5 155 2000-06-24 20:28:01Z bears $ .SH NAME noffle.conf \- Configuration file for NOFFLE news server @@ -170,6 +170,20 @@ Default: yes .TP +.B path-header +Articles posted without a Path: header have one added by NOFFLE. +When +.B path-header +has its default value (empty) the header content +is "!not-for-mail". +Use the +.B default-path +setting to provide alternate content for the Path: header. +This will very rarely be necessary. +.br +Default: + +.TP .B default-expire The default expiry period, in days. An expiry period of 0 means "never". .br diff -r d23f038454d4 -r 6f681d41734c src/configfile.c --- a/src/configfile.c Sat Jun 24 21:20:01 2000 +0100 +++ b/src/configfile.c Sat Jun 24 21:28:01 2000 +0100 @@ -6,7 +6,7 @@ SPOOLDIR VERSION - $Id: configfile.c 143 2000-06-13 06:34:25Z bears $ + $Id: configfile.c 155 2000-06-24 20:28:01Z bears $ */ #if HAVE_CONFIG_H @@ -89,6 +89,7 @@ int numAutoSubscribeMode; int maxAutoSubscribeMode; AutoSubscribeModeEntry *autoSubscribeMode; + Str pathHeader; } config = { SPOOLDIR, /* spoolDir */ @@ -114,7 +115,8 @@ NULL, /* expire */ 0, /* numAutoSubscribeMode */ 0, /* maxAutoSubscribeMode */ - NULL /* autoSubscribeMode */ + NULL, /* autoSubscribeMode */ + "" /* pathHeader */ }; const char * Cfg_spoolDir( void ) { return config.spoolDir; } @@ -133,6 +135,7 @@ return config.defaultAutoSubscribeMode; } const char * Cfg_mailTo( void ) { return config.mailTo; } int Cfg_defaultExpire( void ) { return config.defaultExpire; } +const char * Cfg_pathHeader( void ) { return config.pathHeader; } void Cfg_beginServEnum( void ) @@ -612,6 +615,8 @@ getServ( line ); else if ( strcmp( "mail-to", name ) == 0 ) getStr( config.mailTo, p ); + else if ( strcmp( "path-header", name ) == 0 ) + getStr( config.pathHeader, p ); else if ( strcmp( "expire", name ) == 0 ) getExpire( p ); else if ( strcmp( "auto-subscribe-mode", name ) == 0 ) diff -r d23f038454d4 -r 6f681d41734c src/configfile.h --- a/src/configfile.h Sat Jun 24 21:20:01 2000 +0100 +++ b/src/configfile.h Sat Jun 24 21:28:01 2000 +0100 @@ -3,7 +3,7 @@ Common declarations and handling of the configuration file. - $Id: configfile.h 143 2000-06-13 06:34:25Z bears $ + $Id: configfile.h 155 2000-06-24 20:28:01Z bears $ */ #ifndef CONFIGFILE_H @@ -58,6 +58,9 @@ /* Return default auto subscribe mode. Can be: full, thread, over */ const char * Cfg_defaultAutoSubscribeMode( void ); +/* Return Path: header contents */ +const char * Cfg_pathHeader( void ); + void Cfg_read( void ); /* Get a new iterator for get group patterns for the given server */ diff -r d23f038454d4 -r 6f681d41734c src/protocol.c --- a/src/protocol.c Sat Jun 24 21:20:01 2000 +0100 +++ b/src/protocol.c Sat Jun 24 21:28:01 2000 +0100 @@ -1,7 +1,7 @@ /* protocol.c - $Id: protocol.c 65 2000-05-12 16:52:41Z enz $ + $Id: protocol.c 155 2000-06-24 20:28:01Z bears $ */ #if HAVE_CONFIG_H @@ -284,3 +284,14 @@ snprintf( msgId, MAXCHAR, "<%s.%X.%s@%s>", date, rand(), suffix, domain ); ASSERT( Prt_isValidMsgId( msgId ) ); } + +void +Prt_genPathHdr( Str pathHdr, const char *from ) +{ + getDomain( pathHdr, from ); + Utl_catStr( pathHdr, "!not-for-mail" ); +} + + + + diff -r d23f038454d4 -r 6f681d41734c src/protocol.h --- a/src/protocol.h Sat Jun 24 21:20:01 2000 +0100 +++ b/src/protocol.h Sat Jun 24 21:28:01 2000 +0100 @@ -4,7 +4,7 @@ Functions related with the NNTP protocol which are useful for both the server and the client. - $Id: protocol.h 51 2000-05-05 23:49:38Z uh1763 $ + $Id: protocol.h 155 2000-06-24 20:28:01Z bears $ */ #ifndef PRT_H @@ -106,4 +106,7 @@ void Prt_genMsgId( Str msgId, const char *from, const char *suffix ); +void +Prt_genPathHdr( Str pathHdr, const char *from ); + #endif