Hi there,
I've just started comparing my dovecot setup against the iMSCP test box. Yes, my production is still on ispcp and highly customized, so I'm really a bit slow in migration. But anyhow...
The SQL query is using prefetch, which is nice and what I want. Currently I still have the old way of domain, subdomain and aliasdomain queries. Checking through this, I've came across some problems...
The current query:
- user_query = SELECT CONCAT('/var/mail/virtual/', SUBSTRING(`mail_addr`, LOCATE('@', `mail_addr`) +1 ), '/', \ SUBSTRING(`mail_addr`, 1, LOCATE('@', `mail_addr`) -1) ) AS 'home', '1000' AS 'uid', \ '8' AS 'gid', CONCAT('*:bytes=', `quota`, 'B') AS 'quota_rule' FROM `mail_users` \ WHERE `mail_addr` = '%u' AND `status` = 'ok'
The minor problems:
- Compared to the github master I'm missing po_active = 'yes'. But beyond the SQL template I've not found this statement anywhere. It's not in my database (migrated from ispcp) either!
- When running imscp --reconfigure the user and password where overwritten, but it seems that the dovecot.data has not the migrated data from ispcp. There is dovecot_user which doesn't exist. I have ispcp_dovecot!
The trouble:
- the query fetches any email account! It fetches mail accounts and also forwards. So it could deliver to /var/mail/hostmaster! Ok, postfix would rewrite the forward before touching dovecot, but still seems strange.
- There is no iterate query for mail expunge or quota checking using doveadm.
I've added this:
- user_query = SELECT CONCAT('/var/mail/virtual/', SUBSTRING(`mail_addr`, LOCATE('@', `mail_addr`) +1 ), '/', \SUBSTRING(`mail_addr`, 1, LOCATE('@', `mail_addr`) -1) ) AS 'home', '1000' AS 'uid', \'8' AS 'gid', CONCAT('*:bytes=', `quota`, 'B') AS 'quota_rule' FROM `mail_users` \WHERE `mail_addr` = '%u' AND `status` = 'ok' AND `mail_type` LIKE '%%_mail%%'
and this:
Now you can again run 'doveadm quota get -A'. Perhaps nuxwin could incorporate the changes into the template?