LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 02-04-2010, 01:08 PM   #1
wasamzy
Member
 
Registered: Apr 2009
Location: Ghana Accra
Posts: 64

Rep: Reputation: 15
Perl program for mail server


Please what will it take me to write a perl full functioning program to filter emails for specific rules? Will that be possible?

Please this is very urgen I need ideas.


The actual thing am trying to get is to write a perl program and attach to a mail server so that, when the mails come in, the perl script get call and then the perl program will let another external program that is not on the server run and check or filter the mails.

But is any other ideas are there, please they are all invited thank you.
 
Old 02-04-2010, 01:37 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by wasamzy View Post
Please what will it take me to write a perl full functioning program to filter emails for specific rules? Will that be possible?
Yes, very possible. Although, writing one from scratch seems very pointless, since there are so many programs out there already, that do exactly this.
Quote:
Please this is very urgen I need ideas.
Nope, not urgent for anyone here.
Quote:
The actual thing am trying to get is to write a perl program and attach to a mail server so that, when the mails come in, the perl script get call and then the perl program will let another external program that is not on the server run and check or filter the mails.

But is any other ideas are there, please they are all invited thank you.
What 'other ideas' do you want?? Perl can easily do all of this, and has modules specifically written for POP/IMAP mail handling. Regex handling is built in. But when you say "mails come in, the perl script get a call"....not going to happen. The mail server isn't going to run your perl (or whatever other) program for you....that's why there are many mail-checking applications already out there. You can write that as part of your perl program, to check your incoming emails every so often, and do what you want if new ones come in.
 
1 members found this post helpful.
Old 02-04-2010, 07:42 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Here is a very popular one already done in Perl http://spamassassin.apache.org/
 
Old 02-05-2010, 01:15 AM   #4
wasamzy
Member
 
Registered: Apr 2009
Location: Ghana Accra
Posts: 64

Original Poster
Rep: Reputation: 15
Thank you for the reply. But what I am looking for is not a spam program, though that is also good.

When you look at MDaemon, there is a content filter rule that, if a mail header contain to:someone@thisdomain then run a program. Their is an external program and I am looking for a way to put in a rule that, ok let this program run when a match is found.
I hope you got the ideas?

Thank you soo much for your corporations.
 
Old 02-05-2010, 09:57 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by wasamzy View Post
Thank you for the reply. But what I am looking for is not a spam program, though that is also good.

When you look at MDaemon, there is a content filter rule that, if a mail header contain to:someone@thisdomain then run a program. Their is an external program and I am looking for a way to put in a rule that, ok let this program run when a match is found.
I hope you got the ideas?
Sorry, what you wrote makes no sense.

You say yourself that mdaemon has a content filter rule, that if a condition is met, an external program runs. Which is what you're asking for, but you say that mdaemon won't work. (????)

Mdaemon already does what you're wanting, as would ANY other spam filter. Spam is filtered by many means, regex being one of them. Define your own conditions, and you're done.
 
Old 02-05-2010, 10:32 AM   #6
wasamzy
Member
 
Registered: Apr 2009
Location: Ghana Accra
Posts: 64

Original Poster
Rep: Reputation: 15
I am only base my idea on what MDaemon has. There is a program in another box that will run to see if the incoming mail sender is in the database or not.

So I am looking for a way to make the mail server run that external program and base on the result to take action.
 
Old 02-05-2010, 08:40 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by wasamzy View Post
I am only base my idea on what MDaemon has. There is a program in another box that will run to see if the incoming mail sender is in the database or not.

So I am looking for a way to make the mail server run that external program and base on the result to take action.
As previously said, mail servers do not run external programs. If you want it to, then grab the source code for postfix/sendmail/whatever, and add your functionality into it.

Otherwise, the mail servers CAN work with anti-virus/spam filter programs, which already have what you're looking for. Again, what you're wanting to do has already been done, numerous times.
 
Old 02-06-2010, 02:51 AM   #8
wasamzy
Member
 
Registered: Apr 2009
Location: Ghana Accra
Posts: 64

Original Poster
Rep: Reputation: 15
Sorry, if I sound ignorance, but how can I add that functionality when installing postfix source code? I will be very grateful for your help.

Thank you for your replies.
 
Old 02-06-2010, 11:11 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by wasamzy View Post
Sorry, if I sound ignorance, but how can I add that functionality when installing postfix source code? I will be very grateful for your help.

Thank you for your replies.
You open up the source code, read it, then insert your own code into it, to do what you want.

If you don't know how to program, stick with something off-the-shelf, like any of the ALREADY WORKING programs that do exactly what you want.
 
  


Reply



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
perl linux - send mail via Microsoft exchange server bobypt Programming 1 04-11-2008 07:54 AM
Perl/Web (www) server needs to use mail server for sending forms. dskv Linux - Server 4 04-08-2008 12:34 PM
Executing a program on server using CGi/PERl ?! avios Red Hat 1 12-29-2003 02:34 AM

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

All times are GMT -5. The time now is 12:53 PM.

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