procmail
[Top] [All Lists]

Re: How to Store & Forward ?

1999-10-28 17:25:48
tomers(_at_)excite(_dot_)com writes:
I would like to use .procmailrc file to store & forward a message.
I tried:

:0 c
{
! mymail(_at_)host(_dot_)com
ARCHIVE-inbox
}

I forwards the mail, but also stores the email twice in the inbox folder.

I don't think those lines are forwarding the message, but the double
delivery makes sense.  You should always keep in mind that each recipe
has one and only action.  If you want two actions, you need two recipes.
To foward a message and also save a copy, use two recipes:

        :0 c
        ! mymail(_at_)host(_dot_)com

        :0 A:
        ARCHIVE-inbox

The 'c' flag on the first recipe tells procmail to not consider the
message delivered and done with after the forwarding.  The 'A' flag
tells procmail to not process the second recipe unless the conditions
succeeded on the previous recipe (which doesn't have any right now,
but you may have excluded them from your post for some reason).
Since you didn't say whether "ARCHIVE-inbox" is a file or directory,
I'm assuming it's a file and so you should use a locallockfile on it.
That's done by the second colon on the :0 line.


Philip Guenther

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