3 #From root@relay1.mail.uk.psi.net Mon Mar 23 10:54:54 1998
4 #Date: Mon, 23 Mar 1998 10:51:14 +0000
5 #From: Super-User <root@relay1.mail.uk.psi.net>
6 #To: ph10@cus.cam.ac.uk
7 #Subject: Contrib - single line mail queue printer in perl
9 #this simple hacked script produces the queue with one line per message,
10 #to allow you to do the equivalent of
11 # eximq1l | grep 'hotmail.com' | awk '{print $3}'
12 #to extract the message IDs of interesting messages for nefarious purposes.
15 open ( MQ, "/usr/bin/exim -bp|") or die "can't run the exim command\n";
18 $state = 0; # simple state machine
24 if ($state == 0) # line read is the sender info
30 else # line read is a recip
32 if ($line =~ /^$/) # if blank, about to start new mail
37 else # append recipient to line
39 if ($recips > 0) # separate recipients with :
43 if ($line =~ /^\s+\S\s+(.*)/)
47 elsif ($line =~ /^\s+(.*)/)