Re: [Exim] whishlist: move_frozen_messages

Pàgina inicial
Delete this message
Reply to this message
Autor: Paul Rosenberg
Data:  
A: exim-users
Assumpte: Re: [Exim] whishlist: move_frozen_messages
Hi,


On Sat, 5 Feb 2000, robert rotman wrote:

> > > exim makes much work for me to remove the frozen message every day.
> > > i'll like to go on holliday but who removes the tons of frozen messages
> > > ? ;)
> >
> > Is it any more work than to clean out those messages from your postmaster
> > mailbox? At least exim gives you a chance to find and fix the underlying
> > problem so that the frozen message can actually be delivered. That, in my
> > mind, is a decided improvement over sendmail's way of doing things.
> >
>
> yes of course it's easier to type the "d-button" in pine than to log in
> into another machine and start exim with commandline options which you
> should remember and the fuzzy out the right msg-ID
> (once it happens that i deleted the wrong message).
>
> 99% of thees frozen messages haf an emty return-path and sent to the wrong
> username.
>

Useful technique:

I arrange to have a single batch of these "frozen undeliverables"
delivered to postmaster's mailbox early each weekday morning.

These mostly nuisance messages appear together in the mailbox,
sorted by the domain that the error report failed to get back to.

A cron job at appropriate times, e.g.

    40 6 * * 1-5 /u7/local/unstick


running the shell script below does the trick

=====================================================
#!/bin/sh

# make sure the exim binary is on your PATH

/bin/mailq | nawk '
{       if ( $0 ~ /<> \*\*\* frozen \*\*\*/ )
        {       eximmes=$3
                fornex=1
        }
        else if (fornex == 1)
        {       badres=$0
                fornex=0
                sub(/^[         ]*/,"",badres)
                #       Now have an exim messageid in "eximmes"
        #    and the bad sender address in "badres".
                #       Next step is to sort the eximmes-s by the address domains
                print eximmes ":" badres
        }
}
' | sort -t@ -k 2,2 | sed -e 's/:.*//' -e 's".*"exim -Mt &; exim -Mg &"' | sh
# A series of  "exim -Mt" and "exim -Mg" commands are obeyed.
=====================================================


The next trick is to get the bad sender address to appear in the Subject line
when postmaster looks at a folder index containing these messages.

One way of doing that is via postmaster's .procmailrc

# ======REPLACE "gla.ac.uk" below as appropriate========
:0H
* From: Mail Delivery System .Mailer-Daemon.*gla.ac.uk
* Subject: Mail delivery failed
* B ?? ^  \/[^ ]*@[^ ]*:
{
        SUBB=$MATCH


        # Change the subject
         :0 fhw
         |formail -I"Subject: Failed for $SUBB"
}


######################

Best wishes,
Paul R.

Paul Rosenberg, Computing Service, Univ. of Glasgow, Glasgow G12
POSTMASTER@???, Tel +44 (0)141 330 4825, Fax " " " 4808
================================================================