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@iki.fiescreveu:
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.
Tks timo! Monday i will do all corrections!
Em 19/11/2010 22:26, "Timo Sirainen" tss@iki.fiescreveu:
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@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@gmail.com
Tks timo! Monday i will do all corrections!
Em 19/11/2010 22:26, "Timo Sirainen" tss@iki.fiescreveu:
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.
On Mon, 2010-11-22 at 13:38 -0200, Alex Baule wrote:
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@exemplo.com.br \tmailbox\t\\*\tsavedbefore\t1s\n";
Looks like there was also a bug, fixed: http://hg.dovecot.org/dovecot-2.0/rev/b724ef3bdc0a
So what you need to send is:
VERSION\tdoveadm-server\t1\t0 D\tuser@domain\texpunge\tmailbox\t*\tsavedbefore\t1s
There is no escaping for '*', in command line you need to do that only because shell otherwise expands it.
Tks, now it's working, i need to send every in one "write", (header+command)
2010/11/22 Timo Sirainen tss@iki.fi
On Mon, 2010-11-22 at 13:38 -0200, Alex Baule wrote:
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@exemplo.com.br \tmailbox\t\\*\tsavedbefore\t1s\n";
Looks like there was also a bug, fixed: http://hg.dovecot.org/dovecot-2.0/rev/b724ef3bdc0a
So what you need to send is:
VERSION\tdoveadm-server\t1\t0 D\tuser@domain\texpunge\tmailbox\t*\tsavedbefore\t1s
There is no escaping for '*', in command line you need to do that only because shell otherwise expands it.
Hi Timo....
It's me again ! lol
the expunge command works fine in unix socket.
Now, i try to do others commands, like someone that return itens......
the command that i use now is:
"VERSION\tdoveadm-server\t1\t0\nD\talex@exemplo.com.br\tmailbox list\t8\n"
the command is OK, and i think the parameters too, but this not return the mailbox list in unix socket.
how is the protocol flow to doveadm unix socket ?
something like.
write X Read Y shutdown socket
or have another order todo this ?
Tks !
2010/11/22 Alex Baule alexwbaule@gmail.com
Tks, now it's working, i need to send every in one "write", (header+command)
2010/11/22 Timo Sirainen tss@iki.fi
On Mon, 2010-11-22 at 13:38 -0200, Alex Baule wrote:
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@exemplo.com.br \tmailbox\t\\*\tsavedbefore\t1s\n";
Looks like there was also a bug, fixed: http://hg.dovecot.org/dovecot-2.0/rev/b724ef3bdc0a
So what you need to send is:
VERSION\tdoveadm-server\t1\t0 D\tuser@domain\texpunge\tmailbox\t*\tsavedbefore\t1s
There is no escaping for '*', in command line you need to do that only because shell otherwise expands it.
On Tue, 2010-11-23 at 09:07 -0200, Alex Baule wrote:
the command that i use now is:
"VERSION\tdoveadm-server\t1\t0\nD\talex@exemplo.com.br\tmailbox list\t8\n"
the command is OK, and i think the parameters too, but this not return the mailbox list in unix socket.
What's the "8" parameter doing there? You're now asking a mailbox list of a mailbox named "8", and if there is none you won't get any matches.
how is the protocol flow to doveadm unix socket ?
something like.
write X Read Y shutdown socket
or have another order todo this ?
Looks like there were several bugs. I fixed them now in hg. Anyway, you can now do:
- Send VERSION
- Send command
- Read reply line (one for prints, one containing "+" or "-" = success/failure)
- Disconnect or goto 2.
I'm Folling the Wiki, with say if put -8 , give the name in UTF-8, so i put it here too.
if was doing with doveadm it' be something like that:
root@brc:~ # doveadm mailbox list -8 -u alex@exemplo.com.br Emexis Emexis.Whitelist Emexis.Quarantine Emexis.Blacklist Trash Sent Archives Drafts root@brc:~ #
I was trying to import too , using the doveadm command line, but i can import exactly the same struct to my maildir in dovecot.
something like this:
doveadm -Dv import -u alex@exemplo.com.br maildir:/root/Maildir <FOLDER DEST> all
The <FOLDER DEST> can't be the Maildir root dir, to be the exactly copy from source Maildir.
This can be useful, when you want to pass every messages in a plugin....(like my case, to split header and body)
There is possible ?
Tks again !
2010/11/23 Timo Sirainen tss@iki.fi
the command that i use now is:
"VERSION\tdoveadm-server\t1\t0\nD\talex@exemplo.com.br\tmailbox
On Tue, 2010-11-23 at 09:07 -0200, Alex Baule wrote: list\t8\n"
the command is OK, and i think the parameters too, but this not return
the
mailbox list in unix socket.
What's the "8" parameter doing there? You're now asking a mailbox list of a mailbox named "8", and if there is none you won't get any matches.
how is the protocol flow to doveadm unix socket ?
something like.
write X Read Y shutdown socket
or have another order todo this ?
Looks like there were several bugs. I fixed them now in hg. Anyway, you can now do:
- Send VERSION
- Send command
- Read reply line (one for prints, one containing "+" or "-" = success/failure)
- Disconnect or goto 2.
On Tue, 2010-11-23 at 13:54 -0200, Alex Baule wrote:
I'm Folling the Wiki, with say if put -8 , give the name in UTF-8, so i put it here too.
if was doing with doveadm it' be something like that:
root@brc:~ # doveadm mailbox list -8 -u alex@exemplo.com.br
You still need to give the "-" character for doveadm-server too. Giving "8" without the "-" works the same in doveadm command line: it'll list mailboxes matching pattern "8". It makes more sense if you give e.g. "mailbox list foo*" which lists all mailboxes beginning with "foo".
And anyway, -8 is the default, so it's not necessary to give it.
I was trying to import too , using the doveadm command line, but i can import exactly the same struct to my maildir in dovecot.
something like this:
doveadm -Dv import -u alex@exemplo.com.br maildir:/root/Maildir <FOLDER DEST> all
The <FOLDER DEST> can't be the Maildir root dir, to be the exactly copy from source Maildir.
I think you can give "" as the <folder dest>?
Thats Right !! some times i'm so stupid !! lol
i see in source code the
if (*ctx->dest_parent != '\0') {
But i forgot how to pass a NULL value, it´s with ""
Tks again !
PS. This last fixes that you made in doveadm, will be avaliable at next release ? you think in some date ?
2010/11/23 Timo Sirainen tss@iki.fi
I'm Folling the Wiki, with say if put -8 , give the name in UTF-8, so i
On Tue, 2010-11-23 at 13:54 -0200, Alex Baule wrote: put
it here too.
if was doing with doveadm it' be something like that:
root@brc:~ # doveadm mailbox list -8 -u alex@exemplo.com.br
You still need to give the "-" character for doveadm-server too. Giving "8" without the "-" works the same in doveadm command line: it'll list mailboxes matching pattern "8". It makes more sense if you give e.g. "mailbox list foo*" which lists all mailboxes beginning with "foo".
And anyway, -8 is the default, so it's not necessary to give it.
I was trying to import too , using the doveadm command line, but i can import exactly the same struct to my maildir in dovecot.
something like this:
doveadm -Dv import -u alex@exemplo.com.br maildir:/root/Maildir <FOLDER DEST> all
The <FOLDER DEST> can't be the Maildir root dir, to be the exactly copy from source Maildir.
I think you can give "" as the <folder dest>?
participants (2)
-
Alex Baule
-
Timo Sirainen