On Fri, 9 Apr 1999, Philip Hazel wrote:
> > This is useful since you can then take a queue listing and freeze/thaw/cancel
> > or remove mail with specified recipients. The normal split-line listing makes
> > it much harder to do this. [Or am I doing something wrong?]
> Noted, but if you were writing a script to do such things, it is easy
> enough in Perl to suck in the -bp output one message at a time, because
> they are delimited by blank lines and Perl can be made to operate in
> "paragraph mode". That way, you preserve the \n characters, which could
> be useful delimiters.
ah, but if you've got a really really big queue, and you want to produce a
listing, you can then use really basic unix tools like "grep" and "awk" to
manipulate it.
I'll save some bandwidth and post a trivial script here...
For example, get a one-message-per-line listing into a file called mq, grep it
for "hotmail.com" and pipe it into this script which thaws batches of mail;
I'll leave it as an exercise for the reader to make freezers, senders and
canceller versions.
Demonstration of shell hackery coming right up!
#!/bin/sh
# exim-thaw - thaw mail in batches of five, pipe in filtered queue listing
count=0
while read a b mailID1 c
do
read a b mailID2 c
read a b mailID3 c
read a b mailID4 c
read a b mailID5 c
echo "$count : thawing messages ${mailID1} ${mailID2} ${mailID3}
${mailI
D4} ${mailID5}"
/opt/exim/bin/exim -Mf ${mailID1} ${mailID2} ${mailID3} ${mailID4}
${mai
lID5}
count=`expr $count + 5`
done
--
*** Exim information can be found at
http://www.exim.org/ ***