incoming mail shall execute php-script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there,

the task:
Any mail that drops into a specified mailbox shall cause a (php-)script to
immediately react with some action.
Quite a common task, isn't it?

I could use e.g. cron to let a script frequently look for new mail.
But mail drops in only once every few days, so I don't want to execute that
look-for-new-mail-script every 3 minutes. But IF mail drops in, the
reaction should be as quick as possible.

Is there a way to watch the mailbox and run the script when the mb changes?
Or could the mailserver be told to run that script when such mail drops in?

It's a Redhat Linus. Probably running in a more or less "standard"
configuaration (what ever that is...)

I don't know which mailserver is running there, but when I connect via SMTP
the server says:
  ESMTP Sendmail 8.12.10/8.11.6; Fri, 30 Jul 2004 15:30:22 +0200

And on connection via POP3 it says:
  +OK POP3  v2000.70rh server ready

I don't have root access and cannot access the relevant config files. But I
guess I could convince the admin to set up sth. if I tell him exactly what
I want...

Thanks a lot for any idea!

Re: incoming mail shall execute php-script

Followup-to ignored.

Quoted text here. Click to load it

It's quite common... it's called procmail (which is most likely
installed by default on RH), see the NOTES section of "man procmail" for
a quick example.


  Daniel Tryba

Site Timeline