changeset 111:6f681d41734c noffle

[svn] path-header added.
author bears
date Sat, 24 Jun 2000 21:28:01 +0100
parents d23f038454d4
children dd2fbc88601d
files docs/noffle.conf.5 src/configfile.c src/configfile.h src/protocol.c src/protocol.h
diffstat 5 files changed, 42 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 <path header content>
+Articles posted without a Path: header have one added by NOFFLE.
+When
+.B path-header
+has its default value (empty) the header content
+is "<hostname>!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: <empty string>
+
+.TP
 .B default-expire <n>
 The default expiry period, in days. An expiry period of 0 means "never".
 .br
--- 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 )
--- 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 */
--- 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" );
+}
+
+
+
+
--- 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