procmail
[Top] [All Lists]

Re: simple recipe question

1998-12-22 10:03:06
1998-12-21-09:14:36 Chuck Campbell:
I have set up a simple recipe that I thought would do what I wanted, which is
to copy all incoming email to another machine, and then can the email.

Well, the simplest version would be to skip procmail entirely, and just do the
deed in your .forward file. In ~/.forward, place the line

        myname(_at_)[xxx(_dot_)xxx(_dot_)xxx(_dot_)xxx]

and that's it. Your email will go there rather than being locally delivered.

To do the same thing with procmail, you could just use

        :0
        ! myname(_at_)[xxx(_dot_)xxx(_dot_)xxx(_dot_)xxx]

Note I left off the "c", for (variously, depending on what sticks in your
memory) "copy" or "continue". The "c" flag causes procmail to "continue"
processing after the recipe, rather than stopping and saying "that's it, I've
disposed of that one, all done", which is the default behavior. (The actual
implementation sometimes, or always, involves forking so there are actually
two procmail processes running; I'm uncertain about when it forks. Not
important in this setting.)

For your more elaborate approach you could use

        :0 c
        ! myname(_at_)[xxx(_dot_)xxx(_dot_)xxx(_dot_)xxx]

        :0
        /dev/null

to make a copy of the message (the "c" in the first recipe) then explicitly
discard it. But you are making one copy, forwarding that, making another copy,
discarding it, and finally falling off the end of dotprocmailrc and so
defaulting to delivery to the default inbox.

-Bennett

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