Update of /cvsroot/tmda/tmda/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv7312/bin

Modified Files:
        ChangeLog tmda-pending 
Log Message:
Add --whitelist and --blacklist command-line options, so that
whitelisting and blacklisting can be done in --batch mode. Requested
by Gre7g Luterman for use in his tmda-pending CGI.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.242
retrieving revision 1.243
diff -u -r1.242 -r1.243
--- ChangeLog   21 Nov 2002 21:13:27 -0000      1.242
+++ ChangeLog   22 Nov 2002 21:50:57 -0000      1.243
@@ -1,3 +1,8 @@
+2002-11-22  Jason R. Mastaler  <[EMAIL PROTECTED]>
+
+       * tmda-pending: Add --whitelist and --blacklist command-line
+       options.
+       
 2002-11-21  Jason R. Mastaler  <[EMAIL PROTECTED]>
 
        * tmda-ofmipd (main): Do port binding before the seteuid call.

Index: tmda-pending
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-pending,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- tmda-pending        21 Nov 2002 23:57:40 -0000      1.36
+++ tmda-pending        22 Nov 2002 21:50:57 -0000      1.37
@@ -51,6 +51,14 @@
     --delete
        Delete messages.
 
+    -B
+    --blacklist
+       Append the sender of the message to the PENDING_BLACKLIST_APPEND file.
+
+    -W
+    --whitelist
+       Append the sender of the message to the PENDING_WHITELIST_APPEND file.
+
     -s
     --summary
        Print a summary of pending messages along with a release address link.
@@ -187,25 +195,27 @@
 
 try:
     opts, args = getopt.getopt(sys.argv[1:],
-                               'c:ipbrdsTSCADR:Y:O:vqVh', ['config-file=',
-                                                           'interactive',
-                                                           'pretend',
-                                                           'batch',
-                                                           'release',
-                                                           'delete',
-                                                           'summary',
-                                                           'terse-summary',
-                                                           'show',
-                                                           'cache',
-                                                           'ascending',
-                                                           'descending',
-                                                           'recipient=',
-                                                           'younger=',
-                                                           'older=',
-                                                           'verbose',
-                                                           'quiet',
-                                                           'version',
-                                                           'help'])
+                               'c:ipbrdBWsTSCADR:Y:O:vqVh', ['config-file=',
+                                                             'interactive',
+                                                             'pretend',
+                                                             'batch',
+                                                             'release',
+                                                             'delete',
+                                                             'blacklist',
+                                                             'whitelist',
+                                                             'summary',
+                                                             'terse-summary',
+                                                             'show',
+                                                             'cache',
+                                                             'ascending',
+                                                             'descending',
+                                                             'recipient=',
+                                                             'younger=',
+                                                             'older=',
+                                                             'verbose',
+                                                             'quiet',
+                                                             'version',
+                                                             'help'])
 except getopt.error, msg:
     usage(1, msg)
 
@@ -230,6 +240,10 @@
         dispose = 'release'
     elif opt in ('-d', '--delete'):
         dispose = 'delete'
+    elif opt in ('-B', '--blacklist'):
+        dispose = 'blacklist'
+    elif opt in ('-W', '--whitelist'):
+        dispose = 'whitelist'
     elif opt in ('-s', '--summary'):
         summary = 1
     elif opt in ('-T', '--terse-summary'):
@@ -258,6 +272,7 @@
 
 from TMDA import Cookie
 from TMDA import Defaults
+from TMDA import Errors
 from TMDA import Util
 
 
@@ -451,9 +466,9 @@
                         dispose = 'release'
                     elif ans == 'd':
                         dispose = 'delete'
-                    elif ans == 'w' and Defaults.PENDING_WHITELIST_APPEND:
+                    elif ans == 'w':
                         dispose = 'whitelist'
-                    elif ans == 'b' and Defaults.PENDING_BLACKLIST_APPEND:
+                    elif ans == 'b':
                         dispose = 'blacklist'
                     elif ans == "q":
                         break
@@ -486,10 +501,16 @@
                     if Defaults.PENDING_WHITELIST_APPEND:
                         Util.append_to_file(return_path,
                                             Defaults.PENDING_WHITELIST_APPEND)
+                    else:
+                        raise Errors.ConfigError, \
+                              'PENDING_WHITELIST_APPEND not defined!'
                elif dispose == 'blacklist':
                     if Defaults.PENDING_BLACKLIST_APPEND:
                         Util.append_to_file(return_path,
                                             Defaults.PENDING_BLACKLIST_APPEND)
+                    else:
+                        raise Errors.ConfigError, \
+                              'PENDING_BLACKLIST_APPEND not defined!'
                 elif dispose == 'pass':
                     continue
                 elif dispose == 'show':

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to