LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-30-2010, 12:57 AM   #1
cor9957
LQ Newbie
 
Registered: Dec 2006
Location: IJmuiden, the Netherlands
Distribution: CentOS, Fedora, Ubuntu
Posts: 24

Rep: Reputation: 10
Procmail decision based on content of attachment


Hi all,

Is it possible to have procmail make a decision based on the content of a attachment?
My situation is the following, I dailty receive a email from a server on which a backup job of a Progress database is run. This job e-mails the results of the backup in an attachment, based on the result I would like to change the header of the message stating that the backup finished successfully or not.
I've added an example attachment to this post.
I hope there is some procmail guru out there who can help me.

Regards,
Cor van den Berghe
Attached Files
File Type: txt dbbackup_log.txt (897 Bytes, 11 views)
 
Old 11-30-2010, 07:14 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
'man procmailex' tells you that a recipe starting with egreps the message body for a string:
Code:
:0 Bb
* ^.*verified.ok
and 'man formail' says to use "-a field name" to add a header field to a message so yes, this seems possible.
Of course it would be way easier to modify the backup script to provide a useful subject line or add a header based on the processes exit status...
 
Old 12-01-2010, 12:42 AM   #3
cor9957
LQ Newbie
 
Registered: Dec 2006
Location: IJmuiden, the Netherlands
Distribution: CentOS, Fedora, Ubuntu
Posts: 24

Original Poster
Rep: Reputation: 10
Thanks for your reply, I'll give it a try as soon as possible.
And your'e absolutely right, it would be a lot easier to adjust the sending script and I will definitely see if if I can change it, but I thought that it might be easier to try it on the receiving side.

Regards,
Cor.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
save mail attachment with procmail graveworm Linux - Networking 2 01-08-2007 08:31 AM
php & imap: where's the Content-type of one attachment? eantoranz Programming 1 05-26-2006 10:37 AM
procmail auto-reply for non-wanted attachment file types make Linux - Software 1 09-26-2005 02:52 AM
Removing Attachment With Procmail joseph Linux - Networking 0 02-17-2005 07:32 PM
Procmail Store Mail Attachment mark@mark-goebl Linux - Software 1 01-09-2003 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:44 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