Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jan 1998 22:55:20 -0500
From:      Norman C Rice <nrice@emu.sourcee.com>
To:        "Randy A. Katz" <randyk@ccsales.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: PROCESS THE MAIL - TO SCRIPT
Message-ID:  <19980114225520.56768@emu.sourcee.com>
In-Reply-To: <3.0.5.32.19980114103602.03991e40@ccsales.com>; from Randy A. Katz on Wed, Jan 14, 1998 at 10:36:02AM -0800
References:  <3.0.5.32.19980114103602.03991e40@ccsales.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 14, 1998 at 10:36:02AM -0800, Randy A. Katz wrote:
> Hello,
> 
> I posted this to a different list (procmail) and did not get a response.
> The main issue is initiating a database post from a mailed in form. I know
> others are doing this and I don't want to reinvent the wheel so any
> suggestions would be most appreciated...
> 
> I want to send email to special@mydomain.com and have a filter rule like
> :0
> * ^Received.*special@mydomain.com
> {
> 
>      :0 c
>      ! randyk@virtualisys.com
> 
>      :0
>      | someperlscript.pl
> }
> 
> For some reason it all works except the PERL script doesn't seem to do
> anything with the contents of the message. Does anyone know the correct
> syntax to use inside the PERL script to receive that PIPE?
> 
> Thanx,
> Randy Katz

If I understand what you're trying to accomplish, try using the 
/etc/aliases file with an entry like

special:	|"/path/to/the/script/someperlscript.pl"

and ensure the the PERL script is executable. Of course, you need
to rebuild the aliases database after making the changes (newaliases).
The email will be passed to your script. Sorry that this method
doesn't use procmail, but I have found it useful.

If you need information on a PERL script, let me know what you're
trying to do. I use the following to capture the pipe.

while (<STDIN>) {
   # do something useful
}

-- 
Regards,
Norman C. Rice, Jr.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980114225520.56768>