[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Importing mail into MySql DB?



Hi there,

I don't think qmail-sql is what you're looking for.
Qmail-sql stores in DB (mysql, etc.) the virtual domains + users
informations.

As for the reason you said, there are other ways:
1) do a pop3 reader (php/python, etc.)
2) do a .qmail script for incoming mail which reads from STDIN (eg:
cat > /tmp/myfile ... then parse the temp file to extract what you
need).


option 2 answers your question of executing a script on the incoming
mail.

i think the syntax is something like:
|/path/to/my/executable/script

then if you want to also save the mail in your inbox add:
./Maildir/

for parsing i recommend the python email package, which does a
wonderful job.

good luck!

Wednesday, April 26, 2006, 11:56:30 PM, James Conaway wrote:
> Assume I know nothing about Qmail. I believe my server runs
> Redhat with plesk. It is a godaddy.com virtual dedicated server that
> I am assuming is running Qmail from the documentation I have read. 

> Need: 

> 1. I would like to have incoming emails be imported into a MySql DB.
> 2. In addition (if possible) import created id's for attachments
> and have the attachments renamed and placed into a directory. (This
> would probably have to have a custom script created for this process
> and I have read Qmail can exectue scripts when email's come in?) 

> Reason:

> I need to be able to place emails/attachments on a webpage.

> I have researched this question before landing here and the
> following is all I could find in the mail list archive regarding it.
 
 
 
> Quote:
>     Jerry Gardner <charlie@xxxxxxxxxxxxxxx> wrote:
 >> >> I've done the search and found all the info as it relates to using MySQL to
>> >> store qmail user configuration data. Has anyone ever given any thought to
>> >> using MySQL to store email messages themselves, instead of using Maildir or
>> >> mbox format?
>> 
>> > Why? Email is a blob of text. Using an RDBMS to store simple blobs of text
>> > is like pounding nails with a 1967 Corvette.
>> >
>> > What problem are you trying to solve? 
>> 
>> Storing mail for a mailing list that generates thousands of messages a week,
>> that also has the ability to serve up archives via a web page.

> It would be much more efficient to simply store the messages in 
> possibly-hashed directories, like ezmlm does with its archives, but yes, you
> could also stick them into an RDBMS from a .qmail file trivially. It's been
> discussed on the list in the past.

> Charles
> --  


 
 
> Quote:
>     It would be much more efficient to simply store the messages in
> possibly-hashed directories, like ezmlm does with its archives, but yes, you
> could also stick them into an RDBMS from a .qmail file trivially. 


> Apparently its possible, but I do not understand the solution he
> proposed and I was hoping someone here could give me more detail on
> how to do something like this. 

> Thank you.
  


-- 
Catalin Constantin
Bounce Software
http://www.bounce-software.com
http://www.cabanova.ro