Hi there,
I have set up Qmail + Courier IMAP/POP + Maildrop on my new system. I
couldn't be happier with it. I have one question however. I would like to
pipe an email through a program rather than sending it to a mailbox and I
am not sure how to do that. I can pipe it to a program via .qmail files
however the email is not passed via STDIN as I thought. I have no idea
where it is. Here it the script I wrote.
--------------------------------------------------------
$email=<STDIN>;
open(FILE, ">/tmp/test.email");
$numArgs = $#ARGV + 1;
print FILE "thanks, you gave me $numArgs command-line arguments.\n";
print FILE $email;
close(FILE);
--------------------------------------------
This is what is outputs.
---------------------------------------------
thanks, you gave me 0 command-line arguments.
Received: (qmail 13531 invoked from network); 5 Mar 2003 05:53:41 -0000
--------------------------------------------------------------
So how can I get the email sent to script for parsing???
I am of course using maildrop to deliver, my qmail rc file looks like this.
exec env - PATH="/var/qmail/bin:$PATH" qmail-start '|preline maildrop'
splogger qmail
So I think that at the point the .qmail file is read maildrop is in
charge, correct me if I am wrong.
What I would really love something like a flow chart showing me what
happens when the mail comes in and how it is passed from qmail to
maildrop.
Thanks Ken