CVS: tmda/bin ChangeLog,1.283,1.284 tmda-rfilter,1.102,1.103

"Jason R. Mastaler" <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv20607/bin

Modified Files:
	ChangeLog tmda-rfilter 
Log Message:
aNew feature.  The `confirm' FILTER_INCOMING action now takes an
optional 'template' argument which directs a specific template to be
used rather than the default template (confirm_request.txt).

The argument can either be an absolute pathname (including tilde
expansion) or a relative (to TEMPLATE_DIR) pathname.  Assuming
TEMPLATE_DIR is set to ~/.tmda/templates, each of the following
instructions are equivalent:

 from johndoe* bounce = /users/jasonrm/.tmda/templates/confirm_johndoe.txt
 from johndoe* bounce = ~/.tmda/templates/confirm_johndoe.txt
 from johndoe* bounce = ~jasonrm/.tmda/templates/confirm_johndoe.txt
 from johndoe* bounce = confirm_johndoe.txt


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.283
retrieving revision 1.284
diff -u -r1.283 -r1.284
--- ChangeLog	19 Jul 2003 04:29:26 -0000	1.283
+++ ChangeLog	20 Aug 2003 00:28:03 -0000	1.284
@@ -1,3 +1,8 @@
+2003-08-19  Jason R. Mastaler  <[email protected]>
+
+	* tmda-rfilter (main): Support confirm=template FILTER_INCOMING
+	instructions.
+	
 2003-07-18  Tim Legant  <[email protected]>
 
 	* tmda-rfilter (opt processing): Added '-p/--print' option to

Index: tmda-rfilter
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-rfilter,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- tmda-rfilter	19 Jul 2003 04:29:26 -0000	1.102
+++ tmda-rfilter	20 Aug 2003 00:28:03 -0000	1.103
@@ -721,7 +721,10 @@
                 templatefile = 'bounce.txt'
             bounce_text = Util.wraptext(text)
     elif mode == 'request':               # confirmation requests
-        templatefile = 'confirm_request.txt'
+        if template:
+            templatefile = template
+        else:
+            templatefile = 'confirm_request.txt'
         timestamp = str('%d' %now)
         pid = Defaults.PID
         confirm_accept_address = Cookie.make_confirm_address(recipient_address,
@@ -831,7 +834,7 @@
         if Defaults.FILTER_BOUNCE_CC:
             send_cc(Defaults.FILTER_BOUNCE_CC)
         if option:
-            logit('BOUNCE', '(%s)' % matching_line + '=' + option)
+            logit('BOUNCE', '(%s)' % (matching_line + '=' + option))
             bouncegen('bounce', Defaults.BOUNCE_TEXT_FILTER_INCOMING,
                       template=option)
         else:
@@ -850,8 +853,12 @@
             logit('OK', '(%s)' % matching_line)
             mta.deliver(msgin)
     elif action == 'confirm':
-        logit('CONFIRM', '(%s)' % matching_line)
-        bouncegen('request')
+        if option:
+            logit('CONFIRM', '(%s)' % (matching_line + '=' + option))
+            bouncegen('request', template=option)
+        else:
+            logit('CONFIRM', '(%s)' % matching_line)
+            bouncegen('request')
     elif action == 'hold':
         logit('HOLD', '(%s)' % matching_line)
         bouncegen('hold')

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.