procmail
[Top] [All Lists]

Re: Using procmail to deliver into a MySQL database

2006-02-23 06:46:00
Hello Matt,

Am 2006-02-19 14:12:57, schrieb matt .:
Hi folks,

I am new to procmail.

Is it possible to write a procmail recipe that will take an incoming message
from Postfix and deliver it directly into a MySQL database?  Where do I
start?

I pipe the messages through a BASH script...

First I use 'formail' to get all NECCESARY headers (each has its own
column in the PostgreSQL table).  Then I split the "Headers" from the
"Body" and put the "Headers" and the "Body" into two seperate columns.

I use 'psql' to insert the values into my PostgreSQL.

Now use tsearch2 to index the thing!  -  Its fast as the heaven.

Oh yes, I have ONE table for each mailfolder/mailinglist.

The biggest one holds currently around 340.000 messages (LKM).  The full
PostgreSQL stores now over 28.000.000 messages.

Please note, that it requires around 7 kByte per message (PostgreSQL
compress the most stuff automaticly) and it has currently a size of
around 200 GByte of 450 GByte (3Ware Raid-5 with WD Raptor 150 GByte)
availlable.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail