Hello all! I tried to add the expire-plugin to my dovecot-installation (CentOS-RPM: dovecot-1.1.1-2_76.el5) and followed the plugin-page from the WIKI (http://wiki.dovecot.org/Plugins/Expire). Unfortunately I have problems with the dictionary: --> dovecot: Aug 05 13:30:25 Error: dict: Unknown dict module: db dovecot: Aug 05 13:30:25 Error: dict: Failed to initialize dictionary 'expire' <-- As far as I understand the hints from mailinglist-archive the db-support is not standard with dovecot and Timo suggested to use a mysql-connection. Are there any further tipps how to use the expire-plugin with mysql-connection (i.e. database-scheme, SQL-Select)? Kind regards, Jens
Jens Meyer wrote:> > Unfortunately I have problems with the dictionary: > --> > dovecot: Aug 05 13:30:25 Error: dict: Unknown dict module: db > dovecot: Aug 05 13:30:25 Error: dict: Failed to initialize dictionary > 'expire' >Looking at the rpm it doesn't look like it has bdb support built in. But it sounds like you want to use Mysql so that's alright.> > Are there any further tipps how to use the expire-plugin with > mysql-connection (i.e. database-scheme, SQL-Select)?You will need to setup your configuration like this: dovecot.conf: dict { ... expiredict = mysql:/opt/dovecot/etc/dovecot-dict-expire.conf ... } plugin { ... expire = Trash 7 Trash/* 7 Spam 3 Junk 3 expire_dict = proxy::expiredict ... } dovecot-dict-expire.conf: connect = host=<host> dbname=<db> user=<username> password=<password> table = expire select_field = timestamp where_field = path username_field = username Then you'll want to create the table like so: create table expire( username varchar(255) not null, path varchar(100) not null, timestamp integer, primary key (username, path))engine=innodb; That should work for you. Of course enter in your correct config location and your specific expire settings. -Eric -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20080805/42530365/attachment-0002.bin>
Hello Eric, thank you very much for your prompt and helpful reply! The connect seem to work fine now. Please allow me two additional questions: Is it correct that this database-table is only a "caching-table" which is empty at first and will be filled later? It is not necessary to adapt the SQL-statement to my user-configuration, is it?! Is it necessary to reference the foldernames with "INBOX.Trash" or only "Trash"? For Sieve I have to use "INBOX.Trash". Actually nothing happens when trying the plugin with "dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test". Thank you again, kind regards! Jens Eric Toczek schrieb:> Jens Meyer wrote: >> Unfortunately I have problems with the dictionary: >> --> >> dovecot: Aug 05 13:30:25 Error: dict: Unknown dict module: db >> dovecot: Aug 05 13:30:25 Error: dict: Failed to initialize dictionary >> 'expire' >> > Looking at the rpm it doesn't look like it has bdb support built in. But > it sounds like you want to use Mysql so that's alright. > >> Are there any further tipps how to use the expire-plugin with >> mysql-connection (i.e. database-scheme, SQL-Select)? > You will need to setup your configuration like this: > > dovecot.conf: > > dict { > ... > expiredict = mysql:/opt/dovecot/etc/dovecot-dict-expire.conf > ... > } > > > plugin { > ... > expire = Trash 7 Trash/* 7 Spam 3 Junk 3 > expire_dict = proxy::expiredict > ... > } > > dovecot-dict-expire.conf: > connect = host=<host> dbname=<db> user=<username> password=<password> > table = expire > select_field = timestamp > where_field = path > username_field = username > > > Then you'll want to create the table like so: > create table expire( username varchar(255) not null, path varchar(100) > not null, timestamp integer, primary key (username, path))engine=innodb; > > That should work for you. Of course enter in your correct config > location and your specific expire settings. > > -Eric >
Dino Ming wrote:> Dear Eric, > > I've enabled the mysql query log, and there does not have any query > when I deleting or moving message. > So, I'm wondering is it have some compile time flag to enable this > perhaps ?Hmm.. shouldn't be any flags needed besides --with-mysql and --with-sql. I wonder if it has to do with the namespace. Try changing expire: Trash 2 to expire: INBOX.Trash 2 I'm not sure how (if) namespaces effect the expire plugin. Timo may be able to shed more light. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20080805/de18e33f/attachment-0002.bin>
Dino Ming wrote:> Dear Eric, > > It's worked after I append the INBOX. in front of Trash > The record entered into the table with path and timestamp, but missing > value for the username. Is this make sense ? >Yup this is as expected. From Timo when I asked him about it: "The expire data is "shared" so username=NULL. You could probably remove the whole username field. I did think about problems related to this yesterday though, so maybe this gets changed somehow some day." Figured since dovecot may use the username at one point, that we should just leave it in the table.> Here come the other questions. When I run the expire-tool, its just > remove the inserted record from the dict_expire table. > But anyway, I will test it for a few days first.Hmm.. odd that it removed it. Run it with a --test and it should tell you what it is doing. Did it remove the message from the Trash too as well as the db entry? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20080805/544e86c7/attachment-0002.bin>