procmail
[Top] [All Lists]

Re: Rather complex recipe -newbie

2002-10-11 15:04:53
At 15:26 2002-10-11 -0400, dennis wrote:
My wife has an email account at work and home. Somehow the home email is being used by some of her colleagues.

Perhaps put the colleague addresses in a list and bounce advisory texts to them informing them of what her proper contact address is. IMO, directly *FIXING* the problem, rather than providing further encouragement to continue using the crutch, is a better solution. You can still forward the message to your wife anyway, but by sending an advisory to people (which I'd do AFTER verifying that the matching criteria worked).

I would like to identify the email coming from her address and forward it to her.

_from_ her address?

The catch is the home email is also still used by me, sometimes.

Perhaps you should sometimes use it even less.

So can I catch the incoming mail from say (her(_at_)homeaddy(_dot_)com)

Uh, I don't follow - if SHE'S sending the mail, why doesn't she just send it to her work address herself? Besides, procmail isn't run on SENT mail, only received email (unless you have some config bodge in place, and if you do, you should be REALLY clear about it).

Perhaps you mean it's mail TO: her at the home domain?

and search the body of the message for her name and then forward it to her work email (her(_at_)workaddy(_dot_)com), plus save a copy on my machine for now?

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
}

# the original message (rather than the 'c'opy from above) will continue on
# through the rest of the procmail script and be handled just as it would
# have normally for received email.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
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>