Hi guys here is a patch for the pending which include --nomodify option

--- tmda-pending        Tue Dec 10 10:15:34 2002
+++ /usr/local/tmda/bin/tmda-pending    Sun Feb  9 17:48:12 2003
@@ -115,6 +115,10 @@
     --quiet
        Suppress output.  Not compatible with --interactive.
 
+    -n
+    --nomodify
+       Do not modify black or whitelist when releasing or deleting
messages.
+
     -V
     --version
        Print TMDA version information and exit.
@@ -183,6 +187,7 @@
 threshold = None
 verbose = 1
 younger = None
+nomodify = None
 
 
 def usage(code, msg=''):
@@ -193,7 +198,7 @@
 
 try:
     opts, args = getopt.getopt(sys.argv[1:],
-                               'c:ipbrdBWsTSCADR:Y:O:vqVh',
['config-file=',
+                               'c:ipbrdBWsTSCADR:Y:O:vqVhn',
['config-file=',
                                                              'interactive',
                                                              'pretend',
                                                              'batch',
@@ -213,7 +218,8 @@
                                                              'verbose',
                                                              'quiet',
                                                              'version',
-                                                             'help'])
+                                                             'help',
+                                                             'nomodify'])
 except getopt.error, msg:
     usage(1, msg)
 
@@ -264,6 +270,8 @@
         threshold = arg
     elif opt in ('-q', '--quiet'):
         verbose = 0
+    elif opt in ('-n', '--nomodify'):
+        nomodify = 1
     elif opt in ('-v', '--verbose'):
         verbose = 1
@@ -299,7 +307,8 @@
             threshold = threshold,
             verbose = verbose,
             younger = younger,
-            pretend = pretend
+            pretend = pretend,
+            nomodify = nomodify
             ).initQueue()
         q.mainLoop()
     except Errors.QueueError, obj:




Here is the patch for the Pending.py too


+++ Pending.py  Sun Dec 29 04:09:10 2002
@@ -49,8 +49,7 @@
                   threshold = None,
                   verbose = 1,
                   younger = None,
-                  pretend = None,
-                  nomodify = None ):
+                  pretend = None ):
 
         self.msgs = msgs
         self.cache = cache
@@ -64,7 +63,6 @@
         self.verbose = verbose
         self.younger = younger
         self.pretend = pretend
-        self.nomodify = nomodify
         self.wantedstdin = 0
 
         self.stdout = sys.stdout
@@ -202,9 +200,9 @@
             return 0
         if not self.pretend:
             if self.dispose == 'release':
-                M.release(nomodify)
+                M.release()
             elif self.dispose == 'delete':
-                M.delete(nomodify)
+                M.delete()
             elif self.dispose == 'whitelist':
                 M.whitelist()
             elif self.dispose == 'blacklist':
@@ -291,8 +289,7 @@
                   threshold = None,
                   verbose = 1,
                   younger = None,
-                  pretend = None,
-                  nomodify =None):
+                  pretend = None ):
 
         Queue.__init__(self,
                        msgs,
@@ -306,8 +303,7 @@
                        threshold,
                        verbose,
                        younger,
-                       pretend,
-                       nomodify)
+                       pretend)
 
 
     def initQueue(self):
@@ -402,14 +398,10 @@
             self.recipient = recipient
         return self
 
-    def release(self, nomodify=0):
+    def release(self):
         """Release a message from the pending queue."""
-        try:
-            self.return_path
-        except:
-            self.initMessage()
         import Cookie
-        if Defaults.PENDING_RELEASE_APPEND and not nomodify:
+        if Defaults.PENDING_RELEASE_APPEND:
             Util.append_to_file(self.return_path,
                                 Defaults.PENDING_RELEASE_APPEND)
         timestamp, pid, suffix = self.msgid.split('.')
@@ -431,23 +423,15 @@
         # Reinject the message to the original envelope recipient.
         Util.sendmail(self.msgobj.as_string(), self.recipient,
self.return_path)
 
-    def delete(self, nomodify=0):
+    def delete(self):
         """Delete a message from the pending queue."""
-        try:
-            self.return_path
-        except:
-            self.initMessage()
-        if Defaults.PENDING_DELETE_APPEND and not nomodify:
+        if Defaults.PENDING_DELETE_APPEND:
             Util.append_to_file(self.return_path,
                                 Defaults.PENDING_DELETE_APPEND)
         os.unlink(self.msgfile)
 
     def whitelist(self):
         """Whitelist the message sender."""
-        try:
-            self.return_path
-        except:
-            self.initMessage()
         if Defaults.PENDING_WHITELIST_APPEND:
             Util.append_to_file(self.return_path,
                                 Defaults.PENDING_WHITELIST_APPEND)
@@ -457,10 +441,6 @@
 
     def blacklist(self):
         """Blacklist the message sender."""
-        try:
-            self.return_path
-        except:
-            self.initMessage()
         if Defaults.PENDING_BLACKLIST_APPEND:
             Util.append_to_file(self.return_path,
                                 Defaults.PENDING_BLACKLIST_APPEND)


So this can be included in the next release.

REMO


_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to