Modifying Dovecot to include its SQL components as well

Bastille

Verified User
Joined
Mar 25, 2013
Messages
97
Not really sure if this is a CB 2.0 issue per se but we're trying this first on our test server that runs CB 2.0, so I figured I might as well as post here instead of the main CB forum.

Is there a way to tweak the install options for Dovecot so that it will work with SQL? I'm trying to get Master Users set up for one of our clients that is managing multiple domains through a reseller account but need to obviously lock it down so that it will only work on certain domains. I had asked the Dovecot mailing list last week if there was a way to set it up through passwd files but never got a response. As a result, I moved on to trying to set up some SQL tables, as at least an example was provided for how to do so on the wiki page.

However, Dovecot isn't configured to have SQL set up in its current form (for obvious reasons, as it's not normally needed) and, while we could rebuild Dovecot manually to get it working, I'm concerned this might clash with CustomBuild update of Dovecot later on. Would it be possible to make such a change?
 
I would suggest you get a directadmin license for testing and build a test vps to try things out. You can use a custom config by copying files to a custom folder in /usr/local/directadmin/custombuild and keeping the same structure.

Example:

Code:
cd /usr/local/directadmin/custombuild
mkdir -p custom/configure/dovecot
cp -rfp configure/dovecot/configure.dovecot custom/configure/dovecot

Then make your code changes to custom/configure/dovecot/configure.dovecot and they will stick next time you run a ./build dovecot
 
Ah I see, thank you. I do have a test server set up with a temporary license so that part isn't a problem at least. Still no luck though, even with enough flags set that it seems redundant.

custom/configure/dovecot
Code:
#!/bin/sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-sql=yes --with-mysql --with-sql-drivers

Output after ./build
Code:
server/usr/local/directadmin/custombuild# dovecot --build-options
Build options: ioloop=epoll notify=inotify ipv6 openssl io_block_size=8192
Mail storages: shared mdbox sdbox maildir mbox cydir imapc pop3c raw fail
SQL drivers:
Passdb: checkpassword passwd passwd-file shadow
Userdb: checkpassword nss passwd prefetch passwd-file
 
You might need to ask smtalk the guy that made custombuild then and ask why it doesnt work. You could also check the dovecot source folder and look at config.log and see if it actually built it with your options.
 
Hmm. Where would that be located? Nothing related turns up when I try to use locate or find to track down config.log
 
custom/ directory should have the same structure (names of the files/folders) inside like the configure/ directory has. The filename should be /usr/local/directadmin/custombuild/custom/dovecot/configure.dovecot. Good luck! :)
 
There we go.

Code:
Build options: ioloop=epoll notify=inotify ipv6 openssl io_block_size=8192
Mail storages: shared mdbox sdbox maildir mbox cydir imapc pop3c raw fail
SQL drivers: mysql
Passdb: checkpassword passwd passwd-file shadow sql
Userdb: checkpassword nss passwd prefetch passwd-file sql

That fixed it. Thank you, smtalk. I take it this would work for custombuild 1.x as well?

Edit: And then, while looking at the SQL query, I realize that all of this work I've been doing for the past week was unnecessary. I had missed the text on Dovecot's Variables page that denotes how to refer to the long names for them. Now I have this working with a secondary passwd file that I can symlink between all of the directories they own. Ugh...
 
Last edited:
Back
Top