Mercurial > noffle
changeset 195:76460d98b2fb noffle
[svn] * noffle.conf.example,docs/noffle.conf.5,src/configfile.h,src/configfile.c,
src/protocol.c: Add new config item 'hostname' to specify the part after
the @ in message IDs generated by Noffle. Patch submitted by Mirko Liss.
author | bears |
---|---|
date | Tue, 30 Oct 2001 13:16:40 +0000 |
parents | a4e9a20e50e5 |
children | 60a70c16d79c |
files | ChangeLog docs/noffle.conf.5 noffle.conf.example src/configfile.c src/configfile.h src/protocol.c |
diffstat | 6 files changed, 36 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Oct 30 12:42:13 2001 +0000 +++ b/ChangeLog Tue Oct 30 13:16:40 2001 +0000 @@ -1,4 +1,10 @@ -Tur Oct 30 2001 Jim Hague <jim.hague@acm.org> +Tue Oct 30 2001 Jim Hague <jim.hague@acm.org> + +* noffle.conf.example,docs/noffle.conf.5,src/configfile.h,src/configfile.c, + src/protocol.c: Add new config item 'hostname' to specify the part after + the @ in message IDs generated by Noffle. Patch submitted by Mirko Liss. + +Tue Oct 30 2001 Jim Hague <jim.hague@acm.org> * docs/noffle.conf.5,src/configfile.c,src/filter.h,src/filter.c: Contrary to the documentation, the action of a filter if not specified
--- a/docs/noffle.conf.5 Tue Oct 30 12:42:13 2001 +0000 +++ b/docs/noffle.conf.5 Tue Oct 30 13:16:40 2001 +0000 @@ -1,5 +1,5 @@ .TH noffle.conf 5 -.\" $Id: noffle.conf.5 313 2001-10-30 12:42:13Z bears $ +.\" $Id: noffle.conf.5 314 2001-10-30 13:16:40Z bears $ .SH NAME noffle.conf \- Configuration file for NOFFLE news server @@ -224,6 +224,15 @@ Default: yes .TP +.B hostname <fully.qualified.domain.name> +Specify right-hand side of Message-IDs generated by NOFFLE. +If omitted, the fully qualified domain name of your system will be used. +If you do not have a fully qualified domain name, your upstream +newsserver or someone else might allow you to use a subdomain name. +.br +Default: <the fully qualified domain name of your system> + +.TP .B path-header <path header content> Articles posted without a Path: header have one added by NOFFLE. When
--- a/noffle.conf.example Tue Oct 30 12:42:13 2001 +0000 +++ b/noffle.conf.example Tue Oct 30 13:16:40 2001 +0000 @@ -56,11 +56,13 @@ default-auto-subscribe-mode full #auto-subscribe-mode *.binaries.* over -# Replace Message-ID in posted articles. 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. +# Replace Message-ID in posted articles. If you are in a local domain, +# ask your news provider for a domain name for generating Message-IDs. +# If the hostname option is unused, it is replaced by the fully qualified +# domain name of your system. replace-messageid yes +#hostname UserId-XXXXX_newsserver # Post articles to remote groups into the local database immediately # on receipt of article.
--- a/src/configfile.c Tue Oct 30 12:42:13 2001 +0000 +++ b/src/configfile.c Tue Oct 30 13:16:40 2001 +0000 @@ -6,7 +6,7 @@ SPOOLDIR VERSION - $Id: configfile.c 313 2001-10-30 12:42:13Z bears $ + $Id: configfile.c 314 2001-10-30 13:16:40Z bears $ */ #if HAVE_CONFIG_H @@ -77,6 +77,7 @@ Bool autoUnsubscribe; Bool infoAlways; Bool replaceMsgId; + Str hostnameMsgId; Bool postLocal; Str defaultAutoSubscribeMode; Str mailTo; @@ -106,6 +107,7 @@ FALSE, /* autoUnsubscribe */ TRUE, /* infoAlways */ TRUE, /* replaceMsgId */ + "", /* hostnameMsgId */ FALSE, /* postLocal */ "over", /* defaultAutoSubscribeMode */ "", /* mailTo */ @@ -136,6 +138,7 @@ Bool Cfg_autoSubscribe( void ) { return config.autoSubscribe; } Bool Cfg_infoAlways( void ) { return config.infoAlways; } Bool Cfg_replaceMsgId( void ) { return config.replaceMsgId; } +const char * Cfg_hostnameMsgId( void ) { return config.hostnameMsgId; } Bool Cfg_postLocal( void ) { return config.postLocal; } const char * Cfg_defaultAutoSubscribeMode( void ) { return config.defaultAutoSubscribeMode; } @@ -869,6 +872,9 @@ getBool( &config.infoAlways, p ); else if ( strcmp( "replace-messageid", name ) == 0 ) getBool( &config.replaceMsgId, p ); + else if ( strcmp( "hostname", name ) == 0 ) + /* use line, do not change to lowercase */ + getStr( config.hostnameMsgId, line ); else if ( strcmp( "post-locally", name ) == 0 ) getBool( &config.postLocal, p ); else if ( strcmp( "default-auto-subscribe-mode", name ) == 0 )
--- a/src/configfile.h Tue Oct 30 12:42:13 2001 +0000 +++ b/src/configfile.h Tue Oct 30 13:16:40 2001 +0000 @@ -3,7 +3,7 @@ Common declarations and handling of the configuration file. - $Id: configfile.h 227 2000-10-26 21:21:13Z bears $ + $Id: configfile.h 314 2001-10-30 13:16:40Z bears $ */ #ifndef CONFIGFILE_H @@ -30,6 +30,7 @@ Bool Cfg_infoAlways( void ); Bool Cfg_replaceMsgId( void ); +const char * Cfg_hostnameMsgId( void ); Bool Cfg_postLocal( void ); const char * Cfg_mailTo( void );
--- a/src/protocol.c Tue Oct 30 12:42:13 2001 +0000 +++ b/src/protocol.c Tue Oct 30 13:16:40 2001 +0000 @@ -1,7 +1,7 @@ /* protocol.c - $Id: protocol.c 300 2001-08-05 08:24:22Z bears $ + $Id: protocol.c 314 2001-10-30 13:16:40Z bears $ */ #if HAVE_CONFIG_H @@ -241,7 +241,10 @@ const char *addTopLevel, *p1, *p2, *p, *domainStart; Str myDomain; - if ( getFQDN( myDomain ) ) + /* get hostname for MsgId from Cfg-File */ + /* more elaborate testing must be left to upstream server */ + Utl_cpyStr( myDomain, Cfg_hostnameMsgId() ); + if ( strlen( myDomain ) != 0 || getFQDN( myDomain ) ) { p = strstr( myDomain, "." ); if ( p != NULL )