Subject: extended header fields

From: Simon McClenahan <[email-masked]>
Date: Fri, 03 Jan 1997 16:22:39 -0600

I want to examine a message header for some "custom made" fields. The only way I can see 
is stolen from mtest.c, where I create a STRINGLIST of valid headers and call 
mail_fetchheader_full() . Is this the only way? I noticed that the string it returns has 
DOS-like CRLF line-endings. How do I stop that?

What I really want is to specify a header field and retrieve the comma delimited data in 
it, e.g.
X-Something: some1, something else, nothing
where I want all the comma delimited data in some sort of string array. Any hints?

    STRINGLIST *lines = mail_newstringlist ();
    STRINGLIST *cur = lines;

    cur->text.size = strlen (cur->text.data = cpystr ("X-Something"));
    cur = cur->next = mail_newstringlist ();
    cur->text.size = strlen (cur->text.data = cpystr ("X-Something-Else"));
    cur = cur->next = mail_newstringlist ();
    cur->text.size = strlen (cur->text.data = cpystr ("X-Another-Thing"));

    /* write it to a file */
    sprintf(commandspath, "%s/%s", dir, COMMANDS_NAME);
    comfile = fopen(commandspath, "w+");
    fputs (mail_fetchheader_full (stream, 1,lines,NIL,NIL), comfile);
    mail_free_stringlist (&lines);

cheers,
-- 
                    Simon McClenahan, an Australian in Iowa
                 and an "I found my wife on the Internet" guy.
        PLEASURE          /                                 BUSINESS
mailto:[email-masked]  /                   [email-masked]
Phone:  +1 319 277 6058 /                     Phone: +1 319 375 1772
                       / USA Toll-free: 800 728 7000 Extension: 1772
http://www.freedomstarr.com/MC2776058.rep

---

From: Mark Crispin <[email-masked]>
Date: Fri, 3 Jan 1997 14:37:02 -0800 (PST)

On Fri, 03 Jan 1997 16:22:39 -0600, Simon McClenahan wrote:
> I want to examine a message header for some "custom made" fields. The only
> way I can see is stolen from mtest.c, where I create a STRINGLIST of valid
> headers and call mail_fetchheader_full() . Is this the only way?

For all intents and purposes, "yes".

> I noticed that the string it returns has

You don't.  c-client deals in Internet standard newlines.  Internet standard
newlines are CRLF.