procmail
[Top] [All Lists]

Re: Filtering Mailer Daemon's

1998-02-27 08:07:01
|Thu 98-02-26 Adrian Lattke <Adrian(_dot_)Lattke(_at_)techonline(_dot_)com> 
list.procmail
| I'm trying to find a way of filtering bounceback emails, and then through a
| perl srcipt, extracting the address it bounced from, and appending it to a
| file.

I have done procmail module to handle daemon messages. Is that any help?
The return value ERROR is set to "yes" for typical daemon messages.
See X-header how to get pm-code.shar from file server.

jari 

Pm-jadaemon.rc -- Handle DAEMON messages by changing subject

    Description
 
        When you sent a message to a address that had delivery troubles,
        you get a DAEMON message back explaining the error problem. I
        usually want to save these daemon mesaages to a different folder
        and check the folder from time to time. A typical daemon message
        is like this (shortened)
 
            From: Mail Delivery Subsystem 
<MAILER-DAEMON(_at_)my(_dot_)domain(_dot_)com>
            Subject: Warning: could not send message for past 4 hours
 
            The original message was received at...
            ----- Transcript of session follows -----
            Deferred: Connection timed out
            ----- Original message follows -----
            [YOUR MESSAGE AS YOU SENT IT WITH HEADERS]
 
        Well, when I read the subjects, I do not like the standard error
        messages, but I also like to know to which address the delivery
        failed and what was the original subject. This small recipe changes
        the daemon message's Subject to
 
            Subject BRIEF-ERROR-REASON, SENT-TO-ADDRESS, ORIGINAL-SUBJECT
 
        and from that you can immediately tell if you should be worried Eg.
        if SENT-TO-ADDRESS was your friend's, then you want to take actions
        immediately, but if it were your complaint to UBE message to
        postmaster, you don't want to bother reading that daemon message.
        Here are some real examples:
 
            fatal errors,postmaster,ABUSE (Was: Super Cool Site!)
            Host unknown,postmaster,ABUSE (Was: A-Credit Information)
            undeliverable,postmaster,Could you investigate this spam
            Warning-Returned,friend,Have you looked at this
 
     Return values
 
        o   Variable ERROR will be set to "yes" if daemon message was handled
            otherwise; value is "no"
 
    Usage example
 
        Just add this recipe somewhere in your .procmailrc
 
            PMSRC           = $HOME/pm
            RC_DAEMON       = $PMSRC/pm-jadaemon.rc
            DAEMON_MBOX     = $HOME/Mail/junk.daemon.mbox
 
            #  ...somewhere in the recipe pile
            INCLUDERC       = $RC_DAEMON
 
            #   If that was a daemon message, put it to folder
            :0 :
            * ERROR ?? yes
            $DAEMON_MBOX
 

<Prev in Thread] Current Thread [Next in Thread>