[Dovecot] Zlib plugin dovecot 2.0beta4
Hi Timo...
I made the plugin like you say.
The header part is saved by dovecot, with o_stream_send , and the body with my function.
This implementation, works fine.
But i need to get / change some values to create the "link" from header to body.
When a email is saved, have the S an W flags, that is the size of email. There is a way to increase this Flags ? I need to put one more line in the header, to have some link to body.
To Increase the S Flag i increase the ostream.offset, but the W is based in the offset from istream, that's right ?
There is a way to do this without rewrite the read function !? Exemple, when the email is moved from tmp to cur.
On Tue, 2010-05-11 at 16:41 -0300, Alex Baule wrote:
But i need to get / change some values to create the "link" from header to body.
When a email is saved, have the S an W flags, that is the size of email. There is a way to increase this Flags ? I need to put one more line in the header, to have some link to body.
So you want to add one header and have the S/W increase the number? The problem isn't only the S/W, it's also that Dovecot saves the message size to cache file. The only good way to solve this is to change your input stream to return the header, so that all of Dovecot's internal code sees it and internally adds them to the S/W/cache.
But do you really even need a header for the link? Maybe you could just use IMAP UID number? Like if you have ~/Maildir/.foo/cur/abcd:2, file with UID=200, its body could be in e.g. ~/Maildir/.foo/body/200.
Mostrar romanização The extra line added to the header is to maintain compatibility with SMTP(share library code), which already works well. Besides having other benefits that are due to the hash in the header.
I tried accessing the same way that istream is done in the zlib ( zlib_permail_get_stream ), where the reference to mail-> uid == 0, (nonzero is to read the file -> dovecot).
if (imail->data.stream != NULL || (_mail->uid == 0 && zuser->disable_uis == 1)) { //disable_uis ir read like the zlib_save variable , if is not present , we don't need to get stream, and works like no modifications. return zmail->super.get_stream(_mail, hdr_size, body_size, stream_r); }else if (imail->data.stream != NULL || _mail->uid == 0 ) { // OK, its a istream from received email. input = imail->data.stream; imail->data.stream = i_stream_create_emx(input); }
But I do not know if it is correct.
If you can tell me where is exactly the way or the point that i must catch the istream input, i do the rest.....
Tks Timo !
2010/5/26 Timo Sirainen tss@iki.fi
On Tue, 2010-05-11 at 16:41 -0300, Alex Baule wrote:
But i need to get / change some values to create the "link" from header to body.
When a email is saved, have the S an W flags, that is the size of email. There is a way to increase this Flags ? I need to put one more line in the header, to have some link to body.
So you want to add one header and have the S/W increase the number? The problem isn't only the S/W, it's also that Dovecot saves the message size to cache file. The only good way to solve this is to change your input stream to return the header, so that all of Dovecot's internal code sees it and internally adds them to the S/W/cache.
But do you really even need a header for the link? Maybe you could just use IMAP UID number? Like if you have ~/Maildir/.foo/cur/abcd:2, file with UID=200, its body could be in e.g. ~/Maildir/.foo/body/200.
participants (2)
-
Alex Baule
-
Timo Sirainen