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 12-19-2006, 01:48 AM   #1
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Procmail - body of message


Hi all,

I'm trying to parse text in a body of a mail message and save some values as variables for a command to run later. I'm researching the net and not really finding anything about parsing the body of mail and saving parts of it as variables.

An example would be mail coming in with a body containing "Source ID: 7599". I want to grab this number and save it as a variable and have procmail run a command (perl script or bash) using this variable. I can write the perl/bash script but I'm not sure how to incorporate this with procmail. Is this even possible with procmail? Thanks.

-twantrd
 
Old 12-19-2006, 07:31 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I haven't parsed the body of an email as the trigger to running a script, but I have parsed headers and then parsed the body of those emails. For example, to match a subject of blah and then run /usr/local/bin/ascript.pl over the body of matching emails:
Code:
:0
* ^Subject: blah
|/usr/bin/perl /usr/local/bin/ascript.pl
 
  


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
Forcing Email Message Body Inline, Not Attached ThisGuyIKnow Linux - General 4 10-17-2006 12:56 PM
Extract body message from raw e-mail rigel_kent Programming 2 06-03-2006 06:07 AM
Thunderbird prints headers OK but message body corrupt Mq2004 Linux - Software 1 04-10-2006 02:52 PM
SMTP logging without including the body of the message jspencereds Linux - Networking 0 04-09-2004 11:33 AM
KMail: execute command depending on message body linuxfond Linux - Newbie 0 01-31-2004 07:30 AM

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

All times are GMT -5. The time now is 03:27 PM.

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