procmail
[Top] [All Lists]

Re: Forwarding of mails and keeping a copy locally

2002-01-08 08:57:13

I am now advancing to "forward" my emails to another account via
"procmail". Am I right to do it the following way?

## Forward a copy of mails from these domains and keep a copy locally
:0c:
* .*techtarget\.com|cisco-personal-updates(_at_)cisco\(_dot_)com

! any(_at_)domain(_dot_)com


Well, you defintely need to remove the blank line, and I would put some header 
there (Like From: and maybe "return path") and you need to put the domains in ( 
) and I personally prefer to put them one per line so you can add other domains 
more easily, and it is more readable

Your current example does not need a local lockfile (the : after the :0c).

So I would write it as:

:0c
* ^(From|Return-Path):.*(techtarget\.com|\
                         someotherdomainhere\.com|\
                         cisco-personal-updates(_at_)cisco\(_dot_)com)
! any(_at_)domain


If I were then going to put it in a special local folder, say 
"ForwardedMessages" I would code it like this

:0
* ^(From|Return-Path):.*(techtarget\.com|\
                         someotherdomainhere\.com|\
                         cisco-personal-updates(_at_)cisco\(_dot_)com)
{

            # Store a local copy first
            :0c:
            ForwardedMessages

            # Forward
            :0
            ! any(_at_)domain
}

(you could also do this other ways, this is just my preference.  For example I 
don't like the 'a' flag because I find it more difficult to scan through my 
.procmailrc and look at 'chunks' when I can't see bracketed sections together.  
It also lets me comment things how I like to do so)

TjL


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