Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Website Design/Showcase (http://www.chiefdelphi.com/forums/forumdisplay.php?f=64)
-   -   Automated Email (http://www.chiefdelphi.com/forums/showthread.php?t=32511)

Jack 11-01-2005 00:05

Automated Email
 
Hey all,

I've tried to google arroud on the internet for an answer to this one, but I haven't seemed to find an answer.

Here's what I'm looking to do. (FYI.. this is a *nix system).

I'd like to have a script run whenever an email to a certian address is receaved. My getto solution right now is to have a cron tab set up to run a script to check for new emails every few minutes. However, if there is a way possible, I'd much rather have the script only run when an email arrives as opposed to running it every few minutes.

I'm not exactly sure of the mail server specs, but if that's important, I can get them.

I'd figure something like this has to be possible, after all auto-responders are sent whenever new mail is receaved, but in my case I don't want to send an email back, I want to execute a script of mine.

Thanks,

Jack

evulish 11-01-2005 01:55

Re: Automated Email
 
You might want to look at procmail. It's pretty common on unix systems. I've never messed with it but it looks like it'll do what you want. There's pretty good documentation in the man page and the FAQ's on procmail's site (procmail.org) have some very basic examples.

Timothy D. Ginn 11-01-2005 11:02

Re: Automated Email
 
Quote:

Originally Posted by Jack
...
However, if there is a way possible, I'd much rather have the script only run when an email arrives as opposed to running it every few minutes.

I'm not exactly sure of the mail server specs, but if that's important, I can get them.
...

The way it's done for the mailman software is like this (in my case its in /etc/aliases, but that can vary depending on system setup):

test: "|/usr/lib/mailman/mail/mailman post test"
(with other aliases setup in a similar way passing different paramaters to the mailman binary).

Joe Ross 11-01-2005 15:22

Re: Automated Email
 
Quote:

Originally Posted by Timothy D. Ginn
The way it's done for the mailman software is like this (in my case its in /etc/aliases, but that can vary depending on system setup):

test: "|/usr/lib/mailman/mail/mailman post test"
(with other aliases setup in a similar way passing different paramaters to the mailman binary).

I thought of recommending that method, but it depends on whether the message also needs to be delivered to the mailbox, besides running the script.

If you only need to run a script when the e-mail is sent, the mailman method will work. If the e-mail needs to be delivered and also the script run, procmail is probably your best bet.

AIBob 24-01-2005 14:36

Re: Automated Email
 
Quote:

Originally Posted by Jack
Hey all,

I've tried to google arroud on the internet for an answer to this one, but I haven't seemed to find an answer.

Here's what I'm looking to do. (FYI.. this is a *nix system).

I'd like to have a script run whenever an email to a certian address is receaved. My getto solution right now is to have a cron tab set up to run a script to check for new emails every few minutes. However, if there is a way possible, I'd much rather have the script only run when an email arrives as opposed to running it every few minutes.

I'm not exactly sure of the mail server specs, but if that's important, I can get them.

I'd figure something like this has to be possible, after all auto-responders are sent whenever new mail is receaved, but in my case I don't want to send an email back, I want to execute a script of mine.

Thanks,

Jack

You really can only do that if you can run a program that checks, so you would need to ask your server to run a program, or run a program on a computer that you control, but make sure its always on.


All times are GMT -5. The time now is 21:17.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi