Subject: Question about env->sparep

From: Jeremy M Schmersal <[email-masked]>
Date: Fri, 16 Apr 2004 14:20:05 -0400

Hello,
  I'm looking for some advice on getting RFC822 headers from messages using
c-client (imap-2002e).  We have some proprietary x-headers in our product.  We
use SET_IMAPEXTRAHEADERS to set our x-headers to fetch (with the prefetch) and
SET_PARSELINE to set our own parseline routine.  This looks to be working
perfectly.  When the FETCH is performed, our parseline routine sees the
x-headers we were expecting.
  We are trying to use the sparep field of the ENVELOPE structure to store the
parsed x-header data in.  In our parseline function we allocate the sparep if
necessary, write the parsed data to it, and we have set SET_FREEENVELOPESPAREP
to release the space when the envelope is destroyed.  The problem appears to be
that the envelope is freed before we get a chance to use the info we've stored
in the sparep. It looks like the IMAP envelope is parsed first, then
imap_parse_header calls rfc822_parse_msg to parse the RFC822 header (including
our x-headers) into a new envelope, and merges it into the existing one (that
holds the IMAP envelope).  It doesn't look like the sparep is being merged in
any way into the existing envelope (things like Newsgroups and Followup-To are),
and so our envelope information is freed along with the new envelope.
  Is this a hole, or am I misunderstanding how to parse custom headers and/or
use the sparep of the envelope?
  Also, what is the preferred method of changing the default IMAP port?  We
haven't had alot of luck with SET_IMAPPORT.

Thanks for any help,
Jeremy Schmersal

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Fri, 16 Apr 2004 15:48:08 -0700 (Pacific Daylight Time)

On Fri, 16 Apr 2004, Jeremy M Schmersal wrote:
> parsed x-header data in.

This is not how the sparep stuff was originally intended to be used; 
however, upon considering your issue I've concluded that it is reasonable 
to do what you suggest.  The obvious addition to imap_parse_header() will 
be in imap-2004; since release candidate 8 is already out, it'll be either 
RC9 if there's an RC9, or the release version.

> haven't had alot of luck with SET_IMAPPORT.

It should work.  What are you trying to do?

-- Mark --

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