How doveadm purge a email ? It's search using the index or scan every directory and open the email to match the search criteria ?
On Thu, 2010-11-18 at 10:08 -0200, Alex Baule wrote:> How doveadm purge a email ?By "purge" do you actually mean the "doveadm purge" command that works only for multi-dbox? Or I'm guessing more likely you mean "doveadm expunge"?> It's search using the index or scan every directory and open the email to > match the search criteria ?This doesn't have much to do with expunging, or even doveadm really. It's done the same way for all doveadm's mail commands (search, fetch, expunge, altmove, etc.) The actual search code is also the same as used by IMAP SEARCH. So, yeah, it'll use indexes as best as it can, but if you try to search based on something that's not in index/cache file (like message body), it'll have to open the mails.
Tks timo! I will take a look in this socket to use it with my schedule. Em 18/11/2010 16:48, "Timo Sirainen" <tss at iki.fi>escreveu: On Thu, 2010-11-18 at 16:21 -0200, Alex Baule wrote:> I will create a schedule to expurge older ema...Yes, in that case the dates are looked up from dovecot.index.cache files.> Maybe i will create a application that makes a pipe to doveadm and call it > to do the job.BTW. It's possible to talk to doveadm server as well via unix/tcp sockets. By default there is $base_dir/doveadm-server unix socket.
Tks timo, my plugin is under imap and pop protocol, i will put it in global conf. The syntax for doveadm in socket, is the same as the doveadm app? Ex. Doveadm expurge -u user mailbox inbox savedbefore 3w Than i create a connection to unix socket and write in socket the "expunge -u user mailbox inbox savedbefore 3w" I made a small socket program, doing this but it doesnt work... Tks Timo Em 19/11/2010 18:16, "Timo Sirainen" <tss at iki.fi>escreveu: On Fri, 2010-11-19 at 15:15 -0200, Alex Baule wrote:> Hi Timo.... > > I have a doubt about the dov...Yes, just like all other Dovecot processes, as long as you keep the mail_plugins setting global (instead of e.g. inside protocol imap {}).> if have a plugin using in IMAP, it's use this > same plugin to do the work (ex> expurge, copy,etc...As long as "doveconf mail_plugins" shows your plugin there, it's used.
On 19.11.2010, at 22.18, Alex Baule wrote:> The syntax for doveadm in socket, is the same as the doveadm app? > > Ex. Doveadm expurge -u user mailbox inbox savedbefore 3wYes, but use tabs instead of spaces for separating parameters.
Tks timo! Monday i will do all corrections! Em 19/11/2010 22:26, "Timo Sirainen" <tss at iki.fi>escreveu: On 19.11.2010, at 22.18, Alex Baule wrote:> The syntax for doveadm in socket, is the same as the d...Yes, but use tabs instead of spaces for separating parameters.
Hi Timo.... Im have a situation here with the syntax for doveadm in a unix socket. My string have it: std::string ask = "D\texpunge\tu\talex at exemplo.com.br \tmailbox\t\\*\tsavedbefore\t1s\n"; My Order todo is. Create socket Connect Write this strinng Read the return Close socket. finish my program. But Still i dont get messages to be expunged, if i call bu doveadm command line, works... There is some header to send before the command ? Tks 2010/11/19 Alex Baule <alexwbaule at gmail.com>> Tks timo! Monday i will do all corrections! > > Em 19/11/2010 22:26, "Timo Sirainen" <tss at iki.fi>escreveu: > > On 19.11.2010, at 22.18, Alex Baule wrote: > > > The syntax for doveadm in socket, is the same as the d... > Yes, but use tabs instead of spaces for separating parameters. > >