procmail
[Top] [All Lists]

Re: Self-Modifying .procmailrc

1997-10-07 09:26:07
        Author:        Jari Aalto 
<jari(_dot_)aalto(_at_)ntc(_dot_)nokia(_dot_)com>
        Original-Date: 07 Oct 1997 18:12:12 +0300
        Message-ID:    
<tb201xmwtv(_dot_)fsf(_at_)pegasus(_dot_)tele(_dot_)nokia(_dot_)fi>

This is great! But whatabout remote-forward-control? I want to
send mail from the current account and get mail forwarded somewhere
according to the Reply-To address:

From: me(_at_)remote(_dot_)com
Subject: forward-on SOME-MAGIG-PASSWORD-STRING
Reply-To: ThisAccount(_at_)here(_dot_)com

The procmail would see if SOME-MAGIG-PASSWORD-STRING matches
and set the current forwarding to ThisAccount(_at_)here(_dot_)com(_dot_)

It would be great if the procmail responded to "me(_at_)remote(_dot_)com" that
"Forward now pointing to ThisAccount(_at_)here(_dot_)com" or "You have no
permission to change Forwarding" if the SOME-MAGIG-PASSWORD-STRING is
invalid.


I wouldn't use the Reply-To because I can't always change that (I use some  
bad DOS/Win email software:

If I were really going to do this, I would start like this:

:0
* ^From me(_at_)remote\(_dot_)com
* ^Return-Path: <me(_at_)remote\(_dot_)com>
* ^From: me(_at_)remote\(_dot_)com
* ^Subject: forward-on SOME-MAGIC-PASSWORD-STRING ()\/
* ^X-Loop: me(_at_)remote\(_dot_)com
{

        :0fhw
        |formail -I"X-Loop: me(_at_)remote(_dot_)com"
        
        :0cwhi
        |echo "${MATCH}" > $HOME/.forwardon
        
        :0a
        | echo "Forwarding has been set to $MATCH" |\
                Mail -s "NOTICE: set mail forwarding to $MATCH" \
                $MATCH me(_at_)remote(_dot_)com
}

The multiple headers should make sure that forgery is difficult, the  
'SOME-MAGIC-PASSWORD-STRING' might as well be in the Subject.


So to turn it on I'd do (from me(_at_)remote(_dot_)com):

echo ''|Mail -s "forward-on SOME-MAGIC-PASSWORD-STRING 
me(_at_)elsewhere(_dot_)com" \
 me(_at_)procmailhost(_dot_)com

It's a start....

TjL

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