procmail
[Top] [All Lists]

Re: Carbon copy for each TO

1997-05-01 12:48:00
Axel Thimm <thimm(_at_)physik(_dot_)fu-berlin(_dot_)de> writes:
Philip Guenther <guenther(_at_)gac(_dot_)edu> writes:
Anyway, the result is they LASTFOLDER is indeed set (unless I'm off my
rocker).  BTW, you can remove the second colon (after the 'c' flag), as
there's no need for a locallockfile on this recipe.

And if it is not, couldn't one use
:0 c
* ^TO.*\<bob\>
{
 ! bob(_at_)mail(_dot_)com
 LASTFOLDER=/has/been/forwarded
}

The contents of a nested block are recipes, not just actions.  Also,
the 'c' flag in this case needs to be on the inner recipe that does the
delivery, not on the entire block.  Therefore the above would need to
be written:

:0
* ^TO_bob\>
{
    :0 c
    ! bob(_at_)mail(_dot_)com

    # Since LASTFOLDER _is_ set, we'll demonstrate with something else
    SOMEFLAG=set
}



and set LASTFOLDER explicitly? (Since LASTFOLDER setting is undocumented, it
may change, even if it works with current procmail versions)

LASTFOLDER is undocumented?  Someone better tell Stephen that so he can
remove the following from the procmailrc(5) manpage:

     LASTFOLDER  This variable is assigned to by  procmail  when-
                 ever  it  is  delivering to a folder or program.
                 It always contains the name of the  last  folder
                 (or program) procmail delivered to.


Another question related to my first is how do I write rules about "If mail
involves in any way bob then ..."
I thought of

TOFROM = (^TO)(^From:(.*[^a-zA-Z])?)

You left out the '|':

        TOFROM = "(^TO_|^From:.*\<)"

Note that the ^TO_ token was added in procmail 3.11pre4.

Philip Guenther

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