Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Oct 26, 2010 6:01 am 
Offline
Senior Newbie

Joined: Thu Sep 17, 2009 2:57 pm
Posts: 19
So, I have a nice Postfix system up and running, using the Linode HOWTO in the library. Virtual users, with MySQL authentication, etc. I would like Postfix to trigger a perl script on the receipt of every email, with the raw email data as a parameter. Is this possible? If so, how?

I've done a similar thing by periodically scanning mailboxes, but I would like it to be more immediately reactive.

Thanks in advance.

EDIT: I guess I could piggyback off the Spam Assassin process, which is run for each email. Is there a better way?


Top
   
 Post subject:
PostPosted: Wed Oct 27, 2010 1:00 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
There are a few options for integrating filters into Postfix, but they can be... complex.

A simpler method might be to watch the directory containing mailboxes with something like inotifywait (looks like similar modules are available for Perl).


Top
   
 Post subject:
PostPosted: Thu Oct 28, 2010 4:54 am 
Offline
Senior Newbie

Joined: Thu Sep 17, 2009 2:57 pm
Posts: 19
Thanks for the info.

All these options could cause bad things to happen to my mail if my script doesn't behave properly. This is a possibiilty due to my limited perl skills. And, you're right, filtering is complex if we don't use the simple (and dangerous) example that Postfix provides.

The ionotify options with perl appears to require a persistent process to wait for the trigger, which I would prefer not to have.

I think I will stick with periodically scanning mailboxes. Thanks for your reply, though.


Top
   
 Post subject:
PostPosted: Thu Oct 28, 2010 11:34 am 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
Periodic might be better. If you receive a sudden deluge of mail and your Perl is expensive, it might result in a denial of service.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group