[Dovecot] Implementation of editheaders in dovecot

Konstantin Lepa konstantin.lepa at gmail.com
Fri Apr 3 20:25:20 EEST 2009


Yeah, but it doesn't work without i_stream_seek(stream, 0) before.

How can I remove EOH after i_stream_create_header_filter (second  
'\n')? Is it possible?
I found next solution:
                 fname = t_strdup(mktemp("/tmp/temp.XXXXXX"));
                 fd = creat(fname, 0600);
                 output = o_stream_create_fd_file(fd, 0, TRUE);
                 o_stream_send_istream(output, tmp);
                 o_stream_flush(output);
                 // some fd manipulations
                 stream = i_stream_create_fd(fd, ...);

But it's so ugly and expensive :-( Maybe, another way?

On Apr 3, 2009, at 20:48 , Timo Sirainen wrote:

> On Fri, 2009-04-03 at 17:37 +0400, Konstantin Lepa wrote:
>> I fixed the problem and I created another :-)
>>
>> I removed header "Subject" and added "X-DSPAM: test value\n\n". Now,
>> problem is message_get_header_size in create_stream_for_msgbody. It
>> returns 0 :-( I don't know how to extract message body properly. Help
>> me to understand usage of struct message_size.
>
> Header comes first in the input stream, then body. So call
> message_get_header_size() first and message_get_body_size() next.
>



More information about the dovecot mailing list