procmail
[Top] [All Lists]

Shell Commands in .procmailrc

2007-05-29 07:39:21
Thank you for your replies.. It reallly helps!

What does "Receive email" mean, here?  If you mean the email has
already been delivered into a mailbox before step (2) begins, the
answer to your question is going to be very different than if the
entire process is supposed to take place as the message arrives
(before it has been placed in a mailbox).


  Well, I am unable to change the C++ program to read from standard input,
so I guess I old have to do the first method where the mail first gets
delivered into a mailbox, and I run a command where I pass that mail file
into the program. So far, I have the following and it is working:

:0c
 $MAILDIR/tmp/mail

:0
#* {other conditions}
* !^FROM_DAEMON
* !^X-Loop:(.*\<)?$NEWFROM$
{

NEWFROM = user(_at_)mydomain
:0 fw
| formail -rkp "> "                    \
          -A "Precedence: junk"        \
          -A "X-Loop: $NEWFROM"        \
          -i "Reply-To: $NEWFROM"      \
          -i "Return-Path: $NEWFROM"   \
          -i "Sender: $NEWFROM"        \
          -i "From: $NEWFROM"          \
          -i "Subject: Auto-Reply"     \
          -s $HOME/extract/extract $MAILDIR/tmp/mail $HOME/extract/

:0
| "$SENDMAIL" $SENDMAILFLAGS -f "$NEWFROM" $SENDER
}

This is taking in the mail and sending it through the extract program and
producing an output in the $HOME/extract folder.

Now, I want to take that output and pass it through another program.
Is it possible to run Shell commands in .procmailrc? I am thinking of
writing the next couple of processes in Perl Script.. Does that sound like a
good plan?

Thanks in advance,
Chirag
____________________________________________________________
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
<Prev in Thread] Current Thread [Next in Thread>
  • Shell Commands in .procmailrc, Chirag Ravishankar <=