procmail
[Top] [All Lists]

how to extract bits and pieces from the message body

2007-06-11 19:52:05
I'm not very strong with procmail matching... :-(

I receive a lot of e-mail with a subject line like:
Fedora 7 Update: xorg-x11-server-1.3.0.0-8.fc7

In the body are more details (nicely consistent)

Name        : xorg-x11-server
Product     : Fedora 7
Version     : 1.3.0.0
Release     : 8.fc7


How can I extract the "Name", "Version" and "Release" information so I 
can use them within procmail?

What I want to do is:
Check if the package is installed: rpm -q <Name>
If the package is not installed, put the message in "folder 1"

If it is installed, compare the reported version/release number against 
the  e-mail Version/Release
If the version in the e-mail is greater than reported by rpm -q, put it 
in "folder 2"
If the version in the e-mail is less/equal, then put it in "folder 3"

Concept is simple... I just need help with coercing procmail into 
getting the details from the message. :-)

Thank you.
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>