LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2003, 06:33 AM   #1
PcHammer
Member
 
Registered: Jan 2001
Location: Ljubljana Slovenija
Distribution: Slackware
Posts: 70

Rep: Reputation: 15
Procmail


Hi all

I just want to ask if anyone have a procmail (or something else) script that would run a program everytime a mail is recived from a specific user.

Regards, PcHammer
 
Old 04-23-2003, 07:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you don't mind running it tru a shellscript you could add this to your .procmailrc. This example recipe searches the mailheader for the address you fill in (<user@dom.ain>), dumps the sender address into the REPLYTO variable and supplies it to the shellscript /path/to/doThis.sh.

:0
* ? (formail -x From: | grep <user@dom.ain>)
REPLYTO=`formail -rtzxFrom:`
| sh /path/to/doThis.sh $REPLYTO

Make sure your script tests for not having empty vars, you could even use a case statement to select action based on the address supplied. I use this for mailing back mpacked attachments, remote reporting, stuff like that. Of course you don't need to use a shellscript, you could pipe anything you isolate tru any app that accepts commandline args and doesn't need to run in interactive mode.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with procmail tekion Linux - Software 1 04-19-2005 09:58 AM
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
procmail divali Linux - Software 2 03-04-2005 08:09 AM
procmail help markehb Linux - Software 0 05-20-2004 09:23 AM
Procmail svsalian Linux - Software 0 09-24-2003 08:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:40 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration