Procmail

Procmail

Here's where it really starts to get interesting. Procmail is the tool that makes the e-mail console possible. Procmail is a program that scans a text file (your e-mail file, which is one giant file when it comes from your MDA) looking for patterns you specify, and then it performs some kind of action that you specify on a particular e-mail within the file. You see, Procmail understands how to read this giant e-mail file and can perform either an action on the text itself or just an action in general. For instance, you might have Procmail scan incoming e-mail and for each subject line have it execute a text-to-speech program so it reads each subject to you when new e-mail arrives (see Chapter 21 , Speech Synthesis, for another way to do this). Kind of cool, right?

Our use of Procmail will involve scanning the subject lines of each e-mail looking for a given pattern that indicates that the body of the e-mail holds a command sequence to be executed and that the output is to be captured and sent back to the sender of the e-mail. You could also have Procmail react to just the sender's e-mail address, but this is not as flexible and there are better ways to lock things down, as you will see in a while. So the big question you should have now is, "How do I tell Procmail how to scan my e-mail and how to do something?" Easy! You create a recipe for Procmail.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net