Hello there,
I have a postfix + dovecot + mysql installation in an ubuntu server. Virtual users and domains in a small mysql db that I manage via a web based mailadmin I wrote myself.
The mysql db I'm talking about has a qmail structure that used to be managed by qmailadmin and worked with vpopmail. As for information, I cannot move to a different structure (exc postfixadmin/postfix) for many reasons, so I was forced to stick with it and configure postfix and dovecot to read that structure...
If you may know, qmail (depends on the configuration) uses a directory hashing like /home/vpopmail/DOMAIN/P/7/USERNAME (something similar) in order to manage large domains, and this is handled by vpopmail. Please refer to these two links for details:
- http://free.acrconsulting.co.uk/email/qmh.html
- https://sourceforge.net/p/vpopmail/mailman/message/2710408/
I saw that dovecot uses something similar which I found in dovecot documentation : http://wiki2.dovecot.org/MailLocation#Directory_hashing
Unfortunately, I cannot find more details, so I'd be thankful if you help me out with the following:
By reading the documentation, I can tell that I can use the dir hashing variables in my dovecot configuration. But, in my case, I get the directory path from my mysql db via dovecot sql user_query - not from mail_location variable in 10-mail.conf Therefore if in case of a first received email for a user: dovecot checks in the db, gets the path and creates the maildir from the given path. In case the maildir column is empty, it fails, and it also fails to authenticate...
So, can dovecot write to mysql? I would like to use directory hashing of dovecot, but from what I can find: If dovecot has mail_location variable set to do the dir hashing, it will not then go and add the created path in my mysql db. While if I try to implement something similar from my web gui application, I'd probably have to rewrite the algorithm that does this!?
Can anyone help me figure out what's the best way to implement this?
Thank you very much in advance for your help!
Best, Altin Ukshini