|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Anyone familar with procmail??
First before I take the time to explain my problem, I'd like to know if anyone has a pretty good grasp on procmail. I've already search the forums and the internet and having a hard time finding my answer.
In brief, I have 2 issues, one is getting mail from procmail to a perl script and back again to be delivered, or someway that perl can deliver it. 2) I have some reciepes that use external files but for some reason it is not working to my expectations. |
|
#2
|
|||
|
|||
|
Take that as a no. oh well, thanks anyway.
|
|
#3
|
|||
|
|||
|
I'm not a procmail guru but I use it regularly in order to handle a number of e-mail accounts, remove spam with spamasassin and forward stuff to my blackberry.
Care to expand on your problem? Kevin |
|
#4
|
|||
|
|||
|
Well KevinSheen, As I been waiting for a response I also have been tackling this problem. Did some more reading and researching.
I figured out grepping external files to match exactly. I hope, I'm in the process of testing it. I also figured how to excute a perl script without errors. With the perl script I can print the environment variables which will come in handy at some point. What I can't get is the email contents (from, to, subject, body). Do you think I would have to set the mail into an ENV? I've read that you can pass the whole email to perl and use either ENV, STDIN, agrs to get it. but niether have works. Or I may be doing it wrong. I think my next stop is the Perl forum. Thanks for the reply Last edited by lunatic : March 11th, 2004 at 11:28 PM. |
|
#5
|
|||
|
|||
|
Perl doesn't care how you feed it the e-mail. In perl there is always more than one way to skin a cat.
It sounds to me like you are going to write something to parse all of the bits of an e-mail. That is one way to do it but have you considered doing a search of CPAN ( URL ). Whenever I need to tackle a problem, I normally poke around there first to see if someone has already tackled that problem. If there is a module you can use, it might make your task much easier. If you want to write it yourself, it might be a good learning excercise. If you want to go the CPAN route, Mail::Header might be a good start if you are just looking at parsing the different message sections. Good luck, Kevin |
|
#6
|
|||
|
|||
|
I want to say thanks again for replying.
I did check out CPAN. All I did was type in "Mail" and got a slew of mods. I was looking at one called "Mail::Audit". The thing about these mods is the lack of documentation. So baically I'm stuck learning how to use it. Which is probably just as good as tackling it myself. Thing is Mail::Header seems to only parse email headers. I'd need something that would be able to parse the body as well. The good thing about Mail::Header is that it's recent. Looking at CPAN again, this time typing "Mail Filter" got me a whole mess of mods just for filtering mail.. I guess now it is just a matter of finding the best one. In a way though, I did hear that pipping mail to a external program/script is sever intensive. So is grepping external files for "keywords". Right now I have a recipe: Code:
MYSUBJECT=`formail -zxSubject:`
:0
* ? grep -i "${MYSUBJECT}" /path/to/list/of/subjects
{
LOG="match on list type
"
:0 B
* ? grep -i /path/to/list/of/keywords
$JUNK
}
as soon as i converted from internal to external grepping, I noticed a slow down on my server. So right now it's not bad, but I don't want it to get worse. Last edited by lunatic : March 13th, 2004 at 01:39 AM. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Mail Server Help > Anyone familar with procmail?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|