Triggering a script
am 10.01.2007 05:30:54 von pmarg212
Greetings,
On an old host, I used a pipe in a .forward file to take all email
coming to me@mydomain.com and forward it to the stdin of a script
(where it was parsed, and a response email was sent).
This method does not seem to be working on my new host. Several email
go through and receive a proper response (by email). Others get no
response, and others get a response like "A message that you sent could
not be delivered to one or more of its recipients. This is a permanent
error. The following address(es) failed: pipe to |php
/home/mydomain/emailer.php."
>From the research I have done, I believe that .forward is not a great
way to go about this. I have seen recommendations for procmail with
formail but I am not clear how they interact and how I could begin
setting that up exactly. Do I need to use a .forward file to trigger
procmail? Or does it work automatically? What would go in the
..procmailrc file?
Is there some better and/or simpler way to go about doing this? A
mailer daemon? etc?
I would even be willing to settle for a simple cron script to just
check for email, but I would prefer an interval less than 1 minutes
(which I do not believe is possible). I got spoiled with the instant
response of my previous setup.
I have little experience with this type of scripting so I would
appreciate any responses or links you all take the time to write.
THANKS,
paul
Re: Triggering a script
am 10.01.2007 08:14:29 von ynotssor
In news:1168403454.645429.274720@i56g2000hsf.googlegroups.com,
pmarg212 wrote:
> What would go in the .procmailrc file?
man -k procmail
will show you procmailex, which you should man for numerous examples. Also
search for "procmail recipes" with your favourite search engine.
Re: Triggering a script
am 10.01.2007 15:24:11 von nospam
On Wed, 9 Jan 2007, pmarg212 wrote:
> way to go about this. I have seen recommendations for procmail with
> formail but I am not clear how they interact and how I could begin
> setting that up exactly. Do I need to use a .forward file to trigger
> procmail? Or does it work automatically? What would go in the
> .procmailrc file?
You do not tell us what OS you have and whether procmail comes bundled
with it or not, nor whether you are root or just an user.
I used procmail on Digital Unix built from source, while now on SuSE
Linux procmail is bundled in the OS, and used as the default delivery
agent if one uses sendmail (not the SuSE default, but if you use it,
it's already procmail-ready)
I have root authority, so even on Digital Unix I configured sendmail to
use procmail as local delivery agent.
The use of procmail invoked by .forward is the typical arrangement for
users who have no root authority. The relevant string is in the procmail
man pages. I did not like it because it spoiled my log file analysis
scripts.
For all the rest (writing procmailrc) look at the man pages and
examples, or numerous resources on the net. My procmailrc is too
complex and nested to be useful to you.
> Is there some better and/or simpler way to go about doing this? A
> mailer daemon? etc?
I guess procmail is fine. I use/d it mainly for spam filtering and
message sorting. But I had a separated account which used to receive IAU
Circulars and archive them in internal web pages. I once also set up an
autoresponder for my deceased director, which informed his
correspondents of his death.
--
------------------------------------------------------------ ----------
nospam@mi.iasf.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.