procmail
[Top] [All Lists]

Re: Help: running a C program when mail arrives

1996-08-08 21:10:32
    > How can I run a C program after I recieve a message.  

This is pretty easy.  Please read the man page for procmailrc for details.
Say the C program is called "foo".  This following recipe will run "foo"
for each incoming message.

    :0
    | foo

David Tamkin correctly reminds me that I should have mentioned and used
the "i" flag in the examples from my previous e-mail.

So, for "C programs", or any kind of program or script which you wish to
invoke and ignore the STDIN, the recipe should use the "i" flag.
Otherwise, procmail will assume an error and "recover" the input for
futher processing.

    # run "foo" and ignore input
    :0i
    | foo

Sorry to have forgotten this important flag for this usage.

Alan

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