summaryrefslogtreecommitdiffstats
path: root/web/attachments/393797-mq-d
blob: 2bc96c110ac9f1760b963fa9fd27ec5db3503676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- check_mailq.pl	2010-11-19 10:09:30.871245273 -0500
+++ /home/jwm/check_mailq	2010-11-19 10:13:33.060816778 -0500
@@ -130,7 +130,26 @@
 ##/var/spool/mqueue/qF/df is empty
 ##                Total Requests: 1
 
-	
+# separate submission/transport queues, empty
+## MSP Queue status...
+## /var/spool/mqueue-client is empty
+##                 Total requests: 0
+## MTA Queue status...
+## /var/spool/mqueue is empty
+##                 Total requests: 0
+# separate submission/transport queues: 1
+## MSP Queue status...
+##                 /var/spool/mqueue-client (1 request)
+## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
+## oAJEfhdW014123        5 Fri Nov 19 14:41 jwm
+##                  (Deferred: Connection refused by [127.0.0.1])
+##                                          root
+##                 Total requests: 1
+## MTA Queue status...
+## /var/spool/mqueue is empty
+##                 Total requests: 0
+
+	my $this_msg_q = 0;
 	while (<MAILQ>) {
 	
 		# match email addr on queue listing
@@ -170,13 +189,18 @@
 	    	#
 		    # single queue: first line
 		    # multi queue: one for each queue. overwrite on multi queue below
-	  	  $msg_q = $1 ;
+		  $this_msg_q = $1 ;
+	  	  $msg_q += $1 ;
 			}
 		} elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
-			print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
-			#
-			# multi queue: last line
-			$msg_q = $1 ;
+			if ($this_msg_q) {
+				$this_msg_q = 0 ;
+			} else {
+				print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
+				#
+				# multi queue: last line
+				$msg_q += $1 ;
+			}
 		}
 	
 	}