Re: [Dovecot] zlib Plugin Dovecot 2.0
Hi Paschal
You do not understand what I want.
I developed a plugin based on the zlib plugin, but want to port it to dovecot 2.0.
There are some differences in the 2.0 plugin, which I did not quite understand how it works for me to readjust it in my plugin.
As in the source code there are not many comments, I do not quite know what each function does, if they are all necessary in my adaptation.
In developing the plugin in version 1.4, Timo helped me a lot.
What I need to know is how the hooks on write emails do this, and what the differences in the read function, since the code is different from version 1.4 to 2.0.
On Fri, 2010-04-09 at 11:42 -0300, Alex Baule wrote:
I developed a plugin based on the zlib plugin, but want to port it to dovecot 2.0.
There are some differences in the 2.0 plugin, which I did not quite understand how it works for me to readjust it in my plugin.
I don't think you need to do (almost?) any changes. v2.0's zlib plugin is very different from v1.x, but that's because I'm using zlib library in a different way. Not because of some istream changes.
Thanks Timo,
I have another question about the plugin.
Part of reading I already migrated, only that the piece of writing (the new part in the plugin) I need to understand some things about the operation in order to migrate and redo the same functions with the separation of body / header
Can you explain to me ?
Tks again !
2010/4/16 Timo Sirainen tss@iki.fi
On Fri, 2010-04-09 at 11:42 -0300, Alex Baule wrote:
I developed a plugin based on the zlib plugin, but want to port it to dovecot 2.0.
There are some differences in the 2.0 plugin, which I did not quite understand how it works for me to readjust it in my plugin.
I don't think you need to do (almost?) any changes. v2.0's zlib plugin is very different from v1.x, but that's because I'm using zlib library in a different way. Not because of some istream changes.
On Fri, 2010-04-16 at 09:55 -0300, Alex Baule wrote:
Part of reading I already migrated, only that the piece of writing (the new part in the plugin) I need to understand some things about the operation in order to migrate and redo the same functions with the separation of body / header
So you also want to add support for the split operating directly during saving new mails?
I guess you can copy&paste most of the code from zlib-plugin.c and just implement a new ostream. ostream-bzlib.c should give a good example. You just need to implement:
sendv(): this works similar to writev() syscall. Here you need to keep read the input bytes and track when the message header ends and write to different files before/after that.
flush(): If you do any buffering, flush it here.
That's about it. Much simpler than istreams!
On Fri, 2010-04-16 at 18:34 +0300, Timo Sirainen wrote:
On Fri, 2010-04-16 at 09:55 -0300, Alex Baule wrote:
Part of reading I already migrated, only that the piece of writing (the new part in the plugin) I need to understand some things about the operation in order to migrate and redo the same functions with the separation of body / header
So you also want to add support for the split operating directly during saving new mails?
I guess you can copy&paste most of the code from zlib-plugin.c and just implement a new ostream. ostream-bzlib.c should give a good example. You just need to implement:
Oh, and the output ostream that you get from create() is the one that ends up in the maildir. So I guess you should be writing headers there, and write the body to another file some other way.
Ok !
That's easy.....
In the sendv rewrite, have this:
for (i = 0; i < iov_count; i++) { if (o_stream_emexis_send_chunk(emexis_stream, iov[i].iov_base, iov[i].iov_len) < 0) return -1; bytes += iov[i].iov_len; }
This iov is every line from the new emaill to save ?
Or this is a email block with X bytes ?
In my function to write email, i split the email by \n, to save it splited, and if the iov is splited by \n, is good for me.
2010/4/16 Timo Sirainen tss@iki.fi
On Fri, 2010-04-16 at 09:55 -0300, Alex Baule wrote:
Part of reading I already migrated, only that the piece of writing (the new part in the plugin) I need to understand some things about the operation in order to migrate and redo the same functions with the separation of
On Fri, 2010-04-16 at 18:34 +0300, Timo Sirainen wrote: body /
header
So you also want to add support for the split operating directly during saving new mails?
I guess you can copy&paste most of the code from zlib-plugin.c and just implement a new ostream. ostream-bzlib.c should give a good example. You just need to implement:
Oh, and the output ostream that you get from create() is the one that ends up in the maildir. So I guess you should be writing headers there, and write the body to another file some other way.
On 16.4.2010, at 19.15, Alex Baule wrote:
This iov is every line from the new emaill to save ?
Or this is a email block with X bytes ?
In my function to write email, i split the email by \n, to save it splited, and if the iov is splited by \n, is good for me.
You can't assume anything about iov. iov_count is typically 1, but can be much more. Each block's length can be from 1 byte to anything (typically less than 8kB I guess).
participants (2)
-
Alex Baule
-
Timo Sirainen