On Tue, May 29, 2007 at 03:45:22PM -0400, Chirag Ravishankar wrote:
1. Is there anyway to simply execute a program that has nothing
to do with the mail? For example, after a mail comes in, it is
sent to my MAILDIR. Can I execute another program that takes that
mail as arguments in the commandline.
Chirag: it's high time you read "man procmailex" along with
"man procmailrc". Really. Please do some basic research
before asking a thousand or so people.
E.g.,
10:06pm [~] 524[1]> man procmailex | grep '|' | grep ls
man: Formatting manual page...
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`
So I would say, um, yes.
2. Can I run system/shell commands in .procmailrc.. like "rm" or
"cp", etc
See above.
3. Just to confirm.. We CANNOT execute PHP scripts in procmail..
can we? If we can, whats an example recipe?
Web Results 1 - 10 of about 739,000 for procmail execute php. (0.10
seconds)
Blog by Email « WordPress Codex
The command to execute will look like:. wget -N
http://example.com/installdir/wp-mail.php. If you use a
different program than wget, substitute that program ...
codex.wordpress.org/Blog_by_Email - 26k - Cached - Similar pages
The first hit has this example. I'm note claiming anything good
or bad about the example -- just that you could answer your own question
in about 10 (or maybe 0.10) seconds.
Procmail Activation
If your server uses procmail (http://www.procmail.org/), a
simple .procmailrc in the blogmailaccounts home directory will
be sufficient.
Shell=/bin/sh<br>
MAILDIR=$HOME/.maildir/
DEFAULT=$MAILDIR
:0
{
:0Wc
./
:0
| wget -N http://example.com/installdir/wp-mail.php
}
This could be more specific, such as capturing certain subject
expressions. Check procmail (http://www.procmail.org/) for more
information.
--
dman
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail