You can't add a header to a message in the mailbox. The only thing you can do is fetch the message, make the alteration to the string, and append it back as a new copy of the message (with a new UID).

To write an "X-Flag" header in an outgoing message, write your own rfc822out_t function, and set it with the mail_parameters() SET_RFC822OUTPUT operation. smtp_mail() and nntp_mail() will both use it when rfc822_output() is called.

Look at rfc822_output() for the default action. Basically, you need to duplicate the action from the line below the comment "encode body as necessary". The important thing is that instead of calling rfc822_header, you call your own function that duplicates the action of rfc822_header() but also does your own header operations. While you're at it, you probably want don't want to write to a fixed buffer the way rfc822_header() does but instead do something that won't risk a buffer overflow.

On Tue, 31 Aug 2004, Shawn Walker wrote:

Well, both actually. I must have been confused of setextendedheaders() from something else then.

Thanks,
Shawn

Mark Crispin wrote:

On Tue, 31 Aug 2004, Shawn Walker wrote:

How would I go about setting a X-Flag in the header?
The setextendedheaders() apparently been nixed.


I've never heard of "setextendedheaders()".

What do you mean by "setting a X-Flag"?

Do you mean adding a header line in an outgoing (to SMTP or NNTP) message that you are composing?

Or, do you mean adding an "X-Flag" header line to a message in the mailbox?

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.


-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to