changeset 500:614a3177b15c noffle tip

Add mail-from option. Some modern mail systems will try and ensure the sender email is a legitimate address. Which will fail if there isn't such an address.
author Jim Hague <jim.hague@acm.org>
date Wed, 14 Aug 2013 12:04:39 +0100
parents 1c4d3397e99f
children
files Makefile.in NEWS docs/noffle.conf.5 noffle.conf.example src/configfile.c src/configfile.h src/fetch.c
diffstat 7 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Wed Aug 14 11:50:21 2013 +0100
+++ b/Makefile.in	Wed Aug 14 12:04:39 2013 +0100
@@ -759,7 +759,6 @@
 	$(INSTALL) -o news -g news -d $(DESTDIR)$(SPOOLDIR)/requested
 	$(INSTALL) -o news -g news -d $(DESTDIR)$(SPOOLDIR)/outgoing
 	$(INSTALL) -o news -g news -d $(DESTDIR)$(SPOOLDIR)/overview
-	$(INSTALL) -o news -g news -d $(DESTDIR)$(SPOOLDIR)/articles
 	chown -R news:news $(DESTDIR)$(SPOOLDIR)
 	$(INSTALL) -m 0755 -o 0 -g 0 -d $(DESTDIR)$(DOCDIR)
 	$(INSTALL_DATA) -o 0 -g 0 $(srcdir)/AUTHORS $(DESTDIR)$(DOCDIR)
--- a/NEWS	Wed Aug 14 11:50:21 2013 +0100
+++ b/NEWS	Wed Aug 14 12:04:39 2013 +0100
@@ -1,6 +1,11 @@
 Current development version:
 ----------------------------
 
+1.2.0-rc2
+---------
+
+* Add new 'mail-from' config item.
+
 1.2.0-rc1
 ---------
 
--- a/docs/noffle.conf.5	Wed Aug 14 11:50:21 2013 +0100
+++ b/docs/noffle.conf.5	Wed Aug 14 12:04:39 2013 +0100
@@ -139,6 +139,12 @@
 Default: <empty string>
 
 .TP
+.B mail\-from <address>
+Email address used as the From: address in failed posting emails.
+.br
+Default: noffle@localhost
+
+.TP
 .B auto\-unsubscribe yes|no
 Automatically remove groups from fetch list if they have not been
 accessed for a number of days. Groups are only unsubscribed if there
--- a/noffle.conf.example	Wed Aug 14 11:50:21 2013 +0100
+++ b/noffle.conf.example	Wed Aug 14 12:04:39 2013 +0100
@@ -19,10 +19,12 @@
 # Only get binaries groups from server 'bins'
 # getgroups *.binaries.*
 
-# Mail address for failed postings
-
+# Email notifications of failed postings to this address.
+# Leave blank to have address extracted from the posted article.
 #mail-to root
 
+# From address for emailed notifications of failed postings.
+#mail-from news@example.com
 
 # Never get more than <max-fetch> articles. Discard oldest, if there are more
 
--- a/src/configfile.c	Wed Aug 14 11:50:21 2013 +0100
+++ b/src/configfile.c	Wed Aug 14 12:04:39 2013 +0100
@@ -83,6 +83,7 @@
     Bool clientAuth;
     Str defaultAutoSubscribeMode;
     Str mailTo;
+    Str mailFrom;
     int defaultExpire;
     int numServ;
     int maxServ;
@@ -118,6 +119,7 @@
     FALSE,    /* clientAuth */
     "over",   /* defaultAutoSubscribeMode */
     "",       /* mailTo */
+    "noffle@localhost", /* mailFrom */
     14,       /* defaultExpire */
     0,        /* numServ */
     0,        /* maxServ */
@@ -154,6 +156,7 @@
 Bool Cfg_needClientAuth( void ) { return config.clientAuth; }
 const char * Cfg_defaultAutoSubscribeMode( void ) {
     return config.defaultAutoSubscribeMode; }
+const char * Cfg_mailFrom( void ) { return config.mailFrom; }
 const char * Cfg_mailTo( void ) { return config.mailTo; }
 int Cfg_defaultExpire( void ) { return config.defaultExpire; }
 const char * Cfg_pathHeader( void ) { return config.pathHeader; }
@@ -989,6 +992,8 @@
             else
                 Utl_cpyStr( config.defaultAutoSubscribeMode, s );
         }
+        else if ( strcmp( "mail-from", name ) == 0 )
+            getStr( config.mailFrom, p );
         else if ( strcmp( "mail-to", name ) == 0 )
             getStr( config.mailTo, p );
         else if ( strcmp( "expire", name ) == 0 )
--- a/src/configfile.h	Wed Aug 14 11:50:21 2013 +0100
+++ b/src/configfile.h	Wed Aug 14 12:04:39 2013 +0100
@@ -34,6 +34,7 @@
 const char * Cfg_hostnameMsgId( void );
 Bool Cfg_postLocal( void );
 const char * Cfg_mailTo( void );
+const char * Cfg_mailFrom( void );
 Bool Cfg_addMsgIdIfMissing( void );
 
 /* Begin iteration through the server names */
--- a/src/fetch.c	Wed Aug 14 11:50:21 2013 +0100
+++ b/src/fetch.c	Wed Aug 14 12:04:39 2013 +0100
@@ -324,6 +324,7 @@
     {
         fprintf( f,
                  "To: %s\n"
+                 "From: %s\n"
                  "Subject: [ NOFFLE: Posting failed ]\n"
                  "\n"
                  "\t[ NOFFLE: POSTING OF ARTICLE FAILED ]\n"
@@ -337,7 +338,7 @@
                  "\n"
                  "%s"
                  ".\n",
-                 sender,
+                 sender, Cfg_mailFrom(),
                  reason, article );
         ret = pclose( f );
         if ( ret != EXIT_SUCCESS )