LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   run a shell script/cronjob when any email arrive to specific email address (http://www.linuxquestions.org/questions/linux-general-1/run-a-shell-script-cronjob-when-any-email-arrive-to-specific-email-address-729445/)

ikillu 05-30-2009 12:12 AM

run a shell script/cronjob when any email arrive to specific email address
 
Hello users,

My server is running RHEL5, I am trying to build a system that, when any email arrive to specific email address (i.e. my-secret@mydomain.com), parse that email and run a shell script.

Is that possible?

any reference will be very helpfully

Thanks.

repo 05-30-2009 12:18 AM

Take a look at fetchmail and procmail

ikillu 05-30-2009 02:37 AM

Quote:

Originally Posted by repo (Post 3557206)
Take a look at fetchmail and procmail

thanks repo, I will look for fetchmail and procmail.

bathory 05-30-2009 08:18 AM

You didn't say what is your mail server, but it can be done. For sendmail you need a .forward file in the user's homedir containing:
Code:

"|/path/to/the/script"
The same way for qmail you need a .qmail file containing the same as above without the quotes.
So I guess the same goes for the other MTAs.

Regards


All times are GMT -5. The time now is 02:53 AM.