[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How do I create a message from RFC822 data!
From: |
Sam Roberts |
Subject: |
How do I create a message from RFC822 data! |
Date: |
Wed, 14 Nov 2001 23:08:27 -0500 |
User-agent: |
Mutt/1.3.16i |
I want to redirect mail,
but I need to change the mailer API,
and I need to create a message_t to test it,
so I need a stream_t made from stdin...
See the attached. Basically, I hacked the file variant of stream_t
so there's one with a constructor that just assigns the FILE* into
the _file_stream object. Works fine.
Now I want to make a message_t. I'm trying based on mh code (I thought
it would be closest since it is one message per file), but the attached
program seems to loop internally, and core dump with a blown stack!
Can somebody point me the right way?
What i need to be able to do is something like:
message_create();
s = stdio_stream_create(stdin)/open();
message_attach_to_stream(s);
h = message_get_header(); // Causing the headers to be read from the stream.
Manipulate the headers in-memory (add message-id, date, etc.).
mailer_send(msg)
which will
readline from message
writeline to wherever
The important thing is that the message data was never loaded into
memory all at once.
Do I need to create a special kind of folder for this, or can I do it
with a message_t?
I want to learn more about these things internals, but a pointer in the
right direction so I don't flail around too much would be handy.
Sam
p.s. I'll try and stick the wicket in sieve now, as a proof-of-concept.
--
Sam Roberts <address@hidden> (Vivez sans temps mort!)
mailer-inject.c
Description: Text document
- How do I create a message from RFC822 data!,
Sam Roberts <=