Please give me a best solution to store all mails (send, receive, forward) in mysql with postfix? and Is this the correct approach?
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.
home_mailbox = Maildir/
and virtual_mailbox_base = /mail
. So, in my case all mail is stored in /mail
, each on it's respective folder inbox/sent and inside the account name parent folder. Also, SMTP is just the protocol postfix uses, postfix is a MTA (Mail Transport System). Postfix devs made it so that it can store mail (until today it's true). –
Erythro You can try on https://wiki.ubuntu.com/PostfixCompleteVirtualMailSystemHowto Virtual mail, domain and user using mysql and postfix.
© 2022 - 2024 — McMap. All rights reserved.