[Dovecot] zlib Plugin Dovecot 2.0 - ostream
Hello Everyone...
In zlib save mail have it:
struct ostream *output;
There is a way to get the file descriptor from output used in ostream zlib plugin ?
to get in istream is i_stream_get_fd, but don't have o_stream_get_fd......
Because my plugin will separate the body of the message header.
With the FD I have control over the message to separate it.
Do you have any suggestions for this separation?
I do not quite understand how the struct ostream works.
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
On Tue, 2010-04-20 at 11:40 -0300, Alex Baule wrote:
There is a way to get the file descriptor from output used in ostream zlib plugin ?
No. Why do you need it? You should be writing to ostream, not to its fd.
You should write the message header to the ostream that you get, and message body to some other file that you create. Use the o_stream_send() function to write the message header to the ostream (which does basically the same as write(fd)). I don't see how getting the stream's fd would help with anything.
On Tue, 2010-04-20 at 11:54 -0300, Alex Baule wrote:
Because my plugin will separate the body of the message header.
With the FD I have control over the message to separate it.
Do you have any suggestions for this separation?
I do not quite understand how the struct ostream works.
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
On Tue, 2010-04-20 at 11:40 -0300, Alex Baule wrote:
There is a way to get the file descriptor from output used in ostream zlib plugin ?
No. Why do you need it? You should be writing to ostream, not to its fd.
If I had the file descriptor, I will reuse my functions to do this, made in a separate library, that i use in the MTA.
So no need to rewrite again the part of split the message.
2010/4/20 Timo Sirainen <tss@iki.fi>
You should write the message header to the ostream that you get, and message body to some other file that you create. Use the o_stream_send() function to write the message header to the ostream (which does basically the same as write(fd)). I don't see how getting the stream's fd would help with anything.
On Tue, 2010-04-20 at 11:54 -0300, Alex Baule wrote:
Because my plugin will separate the body of the message header.
With the FD I have control over the message to separate it.
Do you have any suggestions for this separation?
I do not quite understand how the struct ostream works.
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
On Tue, 2010-04-20 at 11:40 -0300, Alex Baule wrote:
There is a way to get the file descriptor from output used in ostream zlib plugin ?
No. Why do you need it? You should be writing to ostream, not to its fd.
Hi Timo....
I'm doing the plugin based on what you said.
But I'll add a line in the message header, so the S and W (size of email) flags, on the file name has to be changed ... There is a way to do that in the plugin?
2010/4/20 Alex Baule <alexwbaule@gmail.com>
If I had the file descriptor, I will reuse my functions to do this, made in a separate library, that i use in the MTA.
So no need to rewrite again the part of split the message.
2010/4/20 Timo Sirainen <tss@iki.fi>
You should write the message header to the ostream that you get, and message body to some other file that you create. Use the o_stream_send() function to write the message header to the ostream (which does basically the same as write(fd)). I don't see how getting the stream's fd would help with anything.
On Tue, 2010-04-20 at 11:54 -0300, Alex Baule wrote:
Because my plugin will separate the body of the message header.
With the FD I have control over the message to separate it.
Do you have any suggestions for this separation?
I do not quite understand how the struct ostream works.
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
On Tue, 2010-04-20 at 11:40 -0300, Alex Baule wrote:
There is a way to get the file descriptor from output used in ostream zlib plugin ?
No. Why do you need it? You should be writing to ostream, not to its fd.
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.
The second is, the name of file.
I use the o_stream_get_name, passing the output ostream, but the return is empty. The name is avaliable when ?
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
You should write the message header to the ostream that you get, and message body to some other file that you create. Use the o_stream_send() function to write the message header to the ostream (which does basically the same as write(fd)). I don't see how getting the stream's fd would help with anything.
On Tue, 2010-04-20 at 11:54 -0300, Alex Baule wrote:
Because my plugin will separate the body of the message header.
With the FD I have control over the message to separate it.
Do you have any suggestions for this separation?
I do not quite understand how the struct ostream works.
Tks Timo.
2010/4/20 Timo Sirainen <tss@iki.fi>
On Tue, 2010-04-20 at 11:40 -0300, Alex Baule wrote:
There is a way to get the file descriptor from output used in ostream zlib plugin ?
No. Why do you need it? You should be writing to ostream, not to its fd.
participants (2)
-
Alex Baule
-
Timo Sirainen