[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mailrm works?



In article <015b01bd38ba$6f5d4d20$0701a8c0@calvin.ibd.es>,
Alfredo Sanjuan <alfre@ibd.es> wrote:
>There is something wrong with the mailrm script?
>
># mailq
>smtp/xxx.xxx.xx:
>        364747-4647:    smtp; 500 (connect to xxx.xxx.xx [xxx.xx.xx.xx]:
>Connection timed out) (retry in 1m39s, expires in 2d1h, tries=6)
>
># mailrm 364747-4647
>/usr/sbin/mailrm: message 364788-14021 is not queued
>No messages cancelled

Hmm, there seem to be two problems.

First is that the mailrm script does not (yet) know about the hashed
transport directories. The fix goes like this (assuming we only have
one level of hashing):

--------------------------------------------------------------------------
--- mailrm.dist	Sat Jan 10 17:43:21 1998
+++ mailrm	Fri Feb 13 15:58:20 1998
@@ -7,11 +7,16 @@
 trap "rm -f /tmp/cancel$$" 0 1 2 15
 for msgid
 do
-	if [ ! -f $msgid ]; then
+	if [ -f $msgid ]; then
+		subdir=.
+	else
+		subdir=`find . -name $msgid |cut -c3- |cut -d/ -f1`
+	fi
+	if [ ! -f $subdir/$msgid ]; then
 		echo $0: message $msgid is not queued
 		continue
 	fi
-	awk '/^l / { print substr($0,3) ; exit }' < $msgid >> /tmp/cancel$$
+	awk '/^l / { print substr($0,3) ; exit }' < $subdir/$msgid >> /tmp/cancel$$
 done
 if [ -s /tmp/cancel$$ ]; then
 	( echo "To: /dev/null
--------------------------------------------------------------------------

The second is that, even with the patch, the queued message is still
not being removed. Looks like the scheduler (update.c?) is no longer
recognizing cancel messages correctly :(


--
Ambrose C. Li   <acli@mingpaoxpress.com>  +1-416-321-0088
Programmer-analyst/ system administrator/ PC user support
Ming Pao Newspapers (Canada) Ltd. EDP department
1355 Huntingwood Dr., Scarborough (Ont.), Canada  M1S 3J1