LinuxQuestions.org
Help answer threads with 0 replies.
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-08-2012, 03:03 AM   #1
sanjioh
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
[MTA] Best way to get the mail spool to a MySQL database


Hi,

I need to setup a mail server that does a particular thing: it receives mail (from user SMTP submission) and, instead of deliver or relay, "does something" that ends up in having the mail (body + headers + attachments) in a mysql table.
The ideal thing would be some mta that keeps the mail spool directly on a database backend; knowing that this is generally unwanted because of performance and reliability issues (and thus, rightfully, never implemented), I'm trying to figure out a way to get the same result.
Note: strict realtime is NOT a requirement (I'm allowed to do some sort of processing between mail arriving and its insertion in the database).
After a couple of days of brainstorming, I came to a conclusion that relies on Postfix and on some coding: using the after-queue filtering capabilities of Postfix, I would first dump the mail (flat file) in a directory (with a slightly modified version of this bash script: http://www.postfix.org/FILTER_README.html#simple_filter); then, using a cronjob scheduled every, let's say, 5 minutes, invoke some (php? ruby? perl?) script that does the batch import task "out of band" and removes the dump file.
I think that this "decouple" thing should give robustness to the whole process, providing small and single-task scripts for dump and import phases; it should be the "unix way" of doing things right

What do you think? Please correct me if I'm wrong in something. Thank you!

Last edited by sanjioh; 02-08-2012 at 03:15 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to configure Sendmail to store mail in a MySQL database moenterprise Linux - Server 0 08-24-2007 11:59 PM
Postfix won't move mail from /var/spool/mail to /home/vmail jmoschetti45 Linux - Server 13 03-07-2007 06:03 AM
MySQL database - mail label creation mazzo Linux - Software 0 05-25-2006 06:36 AM
spam_buttons move from /var/spool/mail/user to $HOME/mail/Junk paul_mat Linux - Software 0 05-25-2006 02:07 AM
sendmail error Fetching mail could not lock /var/spool/mail/username sukhdev50 Linux - Networking 0 05-04-2005 03:41 AM

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

All times are GMT -5. The time now is 06:16 AM.

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