On Tue, Dec 10, 2002 at 02:05:41PM -0500, Mark Horn wrote:
>My reason for asking this is that I'd like to be able to figure out,
>from the email itself, exactly why TMDA let it through, instead of having
>to search through the log files.  For example, maybe something like:
>
>       X-TMDA-Action: OK (from-file ~/.tmda/lists/whitelist.bareappend accept)
>       X-TMDA-Action: OK good_keyword_cookie "fffl"

Finally got around to implementing this.  Attached is the patch.

Cheers,
- Mark
Index: TMDA/ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.253
diff -u -r1.253 ChangeLog
--- TMDA/ChangeLog      30 Jan 2003 23:32:35 -0000      1.253
+++ TMDA/ChangeLog      13 Feb 2003 05:46:28 -0000
@@ -1,3 +1,8 @@
+2003-02-13  Mark Horn  <[EMAIL PROTECTED]>
+       
+       * Defaults.py: added LOG_HEADER to enable the logfile stuff to
+       get written in a header message.  Defaults to None.
+
 2003-01-30  Jason R. Mastaler  <[EMAIL PROTECTED]>
 
        * Deliver.py (Deliver.__deliver_mbox): The UUCP-style From_ line's
Index: TMDA/Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.168
diff -u -r1.168 Defaults.py
--- TMDA/Defaults.py    12 Dec 2002 22:03:05 -0000      1.168
+++ TMDA/Defaults.py    13 Feb 2003 05:46:29 -0000
@@ -973,6 +973,18 @@
 if not vars().has_key('HOSTNAME'):
     HOSTNAME = Util.gethostname()
     
+# LOG_HEADER
+# Boolean variable that enables logging actions to X-TMDA-Action message
+# header
+#
+# Example:
+# LOGFILE_DEBUG = None
+# LOGFILE_DEBUG = 1
+#
+# Default is off
+if not vars().has_key('LOGFILE_DEBUG'):
+    LOG_HEADER = None
+    
 # LOGFILE_DEBUG
 # Filename which uncaught exceptions should be written to.
 #
Index: bin/ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.253
diff -u -r1.253 ChangeLog
--- bin/ChangeLog       5 Feb 2003 00:05:41 -0000       1.253
+++ bin/ChangeLog       13 Feb 2003 05:46:31 -0000
@@ -1,3 +1,8 @@
+2003-02-13  Mark Horn  <[EMAIL PROTECTED]>
+
+       * tmda-rfilter (logit): added ability to log action to the
+       X-TMDA-Action header
+
 2003-02-04  Tim Legant  <[EMAIL PROTECTED]>
 
        * tmda-ofmipd (run_authprog): Fixed problem with -A's interface to
Index: bin/tmda-rfilter
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-rfilter,v
retrieving revision 1.79
diff -u -r1.79 tmda-rfilter
--- bin/tmda-rfilter    21 Jan 2003 05:36:24 -0000      1.79
+++ bin/tmda-rfilter    13 Feb 2003 05:46:31 -0000
@@ -276,6 +276,8 @@
                                              msg_size = orig_msgin_size,
                                              action_msg = action_msg)
         logger.write()
+    if Defaults.LOG_HEADER and recipient_address:
+       msgin['X-TMDA-Action'] = action_msg
 
 
 def autorespond_to_sender(sender):

Reply via email to