LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-30-2009, 12:12 AM   #1
ikillu
Member
 
Registered: Jul 2004
Posts: 34

Rep: Reputation: 15
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.
 
Old 05-30-2009, 12:18 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,511

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
Take a look at fetchmail and procmail
 
Old 05-30-2009, 02:37 AM   #3
ikillu
Member
 
Registered: Jul 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by repo View Post
Take a look at fetchmail and procmail
thanks repo, I will look for fetchmail and procmail.
 
Old 05-30-2009, 08:18 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to check IP address and send to an email kbrajesh Linux - Networking 4 02-08-2007 03:13 AM
About blocking specific email address alucard001 Linux - Server 1 12-17-2006 07:48 AM
Creating A Second Email Address For Email Account On Sendmail treedstang Linux - Software 1 04-27-2004 10:31 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM
Relay email for specific domains to an external address on a non-standard port BaDaBooM Linux - Networking 2 03-18-2003 10:40 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration