Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best way to store mail in DB (postfix) [closed]

Please give me a best solution to store all mails (send, receive, forward) in mysql with postfix? and Is this the correct approach?

like image 717
superuser Avatar asked Oct 10 '12 08:10

superuser


1 Answers

Postfix server by itself does not store email (not for a long time at least) - it can only temporarily queue until it is forwarded to intended recipient(s). Typically only IMAP (or outdated POP3) servers actually store your email.

Most of the open source IMAP servers (Courier, Cyrus, Dovecot...) do support using MySQL as database to keep meta information like list of users and passwords, list of accepted domains, user aliases, etc. But none even attempt to make use of database like MySQL as actual storage backend.

Of course, if you really feel adventurous, you can try to implement SQL IMAP backend of your own. One of the most important considerations for you would be good support of unlimited length VARCHAR or BLOBs (for email attachments) by database engine. Unfortunately, MySQL is not very good server as far as BLOB support goes (you will have to tweak both client and server config for that). Also, you would probably want to have good transaction support - if you care for safety of your email data. For MySQL that means you must use InnoDB engine.

like image 55
mvp Avatar answered Sep 28 '22 10:09

mvp