procmail
[Top] [All Lists]

Re: Rather complex recipe -newbie

2002-10-15 10:26:20
Sean and Luke thanks for the help,

I am using the following (per Sean) ,but I can't seem to get a response, it appears to be forwarding the mail on to the work address, but there is no autoreply message being generated to the original sender.

Procmail tells me there is no sender, is there someway to define the $REPLYTO that I am somehow missing?

:0c
* ^TO_her(_at_)homeaddy\(_dot_)tld
* ! ^X-Loop:[   ]*her(_at_)homeaddy\(_dot_)tld
* -5 ^0
* B ?? 21 herfirstname
* B ?? 51  herlineofwork
* B ?? 100 herworkdomain
* B ?? 100 herworkconame
* 100 ^From: (list|of|work-related|domains)
{
       # action

       # send advisory text (you need to create the correctaddr.msg file)
       # (purge this entire block if you don't want to send)
       :0ic
       | cat $PMDIR/correctaddr.msg | \
formail -I "Subject: [DELIVERY ADVISORY] Address Correction" \
               -I "To: $REPLYTO" \
               -I "X-Loop: her(_at_)homeaddy(_dot_)tld" \
               -I "From: nobody(_at_)yourdomain(_dot_)tld") \
               | $SENDMAIL -t -f nobody(_at_)yourdomain(_dot_)tld


       # forward
       :0
       | formail -I "X-Loop: her(_at_)homeaddy(_dot_)tld" \
               | $SENDMAIL her(_at_)workaddy(_dot_)tld
}





You might want to use scoring. This would allow you to add "weight" to certain keywords. Otherwise, eliminate the numeric gibberish from the following stuff and combine the keywords into one big or expression

# Adjust the scoring math to suit your tastes.

:0c
* ^TO_her(_at_)homeaddy\(_dot_)tld
* ! ^X-Loop:[   ]*her(_at_)homeaddy\(_dot_)tld
* -5^0
* 2^1 B ?? herfirstname
* 5^1 B ?? herlineofwork
* 10^0 B ?? herworkdomain
* 10^0 B ?? herworkconame
* 10^0 ^From: (list|of|work-related|domains)
{
        # action

        # send advisory text (you need to create the correctaddr.msg file)
        # (purge this entire block if you don't want to send)
        :0ic
        | cat autoreply/correctaddr.msg | \
formail -I "Subject: [DELIVERY ADVISORY] Address Correction" \
                -I "To: $REPLYTO" \
                -I "X-Loop: her(_at_)homeaddy(_dot_)tld" \
                -I "From: NoReply(_at_)yourdomain(_dot_)tld") \
                | $SENDMAIL -t -f NoReply(_at_)yourdomain(_dot_)tld


        # forward
        :0
        | formail -I "X-Loop: her(_at_)homeaddy(_dot_)tld" \
                | $SENDMAIL her(_at_)workaddy(_dot_)tld
}



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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