Mail Server Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationMail Server Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 5th, 2004, 10:47 PM
lunatic lunatic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 150 lunatic User rank is Private First Class (20 - 50 Reputation Level)lunatic User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 50 m 39 sec
Reputation Power: 6
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.

Reply With Quote
  #2  
Old March 7th, 2004, 10:38 PM
lunatic lunatic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 150 lunatic User rank is Private First Class (20 - 50 Reputation Level)lunatic User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 50 m 39 sec
Reputation Power: 6
Take that as a no. oh well, thanks anyway.

Reply With Quote
  #3  
Old March 11th, 2004, 07:15 PM
KevinSheen KevinSheen is offline
Kevin Sheen
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: near Pittsburgh
Posts: 3 KevinSheen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old March 11th, 2004, 11:22 PM
lunatic lunatic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 150 lunatic User rank is Private First Class (20 - 50 Reputation Level)lunatic User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 50 m 39 sec
Reputation Power: 6
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.

Reply With Quote
  #5  
Old March 12th, 2004, 07:49 AM
KevinSheen KevinSheen is offline
Kevin Sheen
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: near Pittsburgh
Posts: 3 KevinSheen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old March 13th, 2004, 01:33 AM
lunatic lunatic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 150 lunatic User rank is Private First Class (20 - 50 Reputation Level)lunatic User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 50 m 39 sec
Reputation Power: 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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationMail Server Help > Anyone familar with procmail??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT