[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-mailutils] modifying mail content
From: |
Info Xwave |
Subject: |
[bug-mailutils] modifying mail content |
Date: |
Mon, 13 Jan 2003 16:14:51 +0100 |
Am I doing something generally wrong?
1)
I simply want to read a MIME mail, perform some modifications
on header values or body content.
Therefore I read in the message from a stream and do things like
message_get_header (message, &header);
header_set_value(header, MU_HEADER_SUBJECT, "A new subject", 1);
or provide a new body:
file_stream_create (&bodyStream, tempFilename, MU_STREAM_READ);
body_set_stream (body, bodyStream, message);
message_set_body(*message, body, NULL);
afterwards I dump my message to stdout to see the modifications:
void DumpMailToScreen (message_t message)
{
char buf[2048];
int offset = 0;
size_t nbytes;
stream_t mailStream = 0;
stream_t stdoutStream = 0;
message_get_stream (message, &mailStream);
stdio_stream_create (&stdoutStream, stdout, 0);
while (stream_readline (mailStream, buf, sizeof (buf), offset,
&nbytes) == 0 && nbytes) {
printf ("%s", buf);
offset += nbytes;
}
stream_destroy (&mailStream, NULL);
stream_flush (stdoutStream);
stream_destroy (&stdoutStream, NULL);
}
unfortunately, I cant see any of my modifications.
I am sure, the problem is in "my garden" but I cant see where...
2)
how can i simply remove all attachments from the read message?
i can so e.g. message_create_attachment, but how
"message_remove_attachment"?
thanks a lot! & greetings
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-mailutils] modifying mail content,
Info Xwave <=