Browse Source

Fix typos in manpage
Fix exit code on errors (http://bugs.debian.org/457299)

Emmanuel Bouthenot 16 years ago
parent
commit
1018c28bab
2 changed files with 7 additions and 7 deletions
  1. 5 5
      pmailq
  2. 2 2
      pmailq.pod

+ 5 - 5
pmailq

@@ -44,17 +44,17 @@ class mailqueue:
     def parse(self):
         
         proc = popen2.Popen3(MAILQ, True)    
-        
+
+        # mail system down ?
         p_ret = proc.wait()
         if p_ret != 0:
-            print "ERROR (%d) !!!:" % p_ret
-            print "".join(proc.childerr.readline())
-            return None
+            sys.stderr.write ("ERR : %s\n" % "".join(proc.childerr.readline()).strip())
+            sys.exit (-1)
 
         # checking empty mail queue
         buffer = proc.fromchild.readlines()
         if len(buffer)>0 and buffer[0].strip() == "Mail queue is empty":
-            print buffer[0].strip()
+            sys.stderr.write ("INFO : %s\n" % buffer[0].strip())
             return None
         
         # skip first and last line

+ 2 - 2
pmailq.pod

@@ -10,8 +10,8 @@ pmailq B<--help>
 
 =head1 DESCRIPTION
 
-pmailq parse output of B<mailq> command from postfix (ie: I<postqueue -p>) and permits
-to perform some actions (like removing or displaying in a machine readable format) in
+pmailq parses output of B<mailq> command from postfix (ie: I<postqueue -p>) and permits
+to perform some actions (like removing or displaying in a machine readable format) on
 a bunch of entries in queue, selected by applying patterns on criterias like email
 address, error message from smtp server, message size, mail status in queue.