Subject: SEARCH HEADER

From: Marcel Parodi <[email-masked]>
Date: Thu, 10 Dec 1998 13:42:27 +0100

I need to write a special purpose IMAP client and started to have a look
at both the c-client library and the Mail::Cclient Perl module.

First question:
Is there a mailing-list or a newsgroup dedicated to Mail::Cclient or is
it suitable to discuss this here on the c-client list?

Second question:
I need to search for non-standard (ie 'X-foobar') header lines. There's
the HEADER key for the SEARCH command in the IMAP specification, but it
seems, that it's not possible to use this with the mail_search function
implemented in imap-4.4/c-client.
I found the function mail_newsearchheader in mail.c which could be useful
for this purpose, but strange enough it's not used at all in the whole code.

Is there any reason why this functionality is missing?
Is there another way to send the command "SEARCH HEADER X-foobar string"
to the IMAP server?

Marcel Parodi.

------------------------------------------------------------------
 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: Thu, 10 Dec 1998 11:42:30 -0800 (PST)

> it suitable to discuss this here on the c-client list?

The c-client mailing list is the correct mailing list.  Or you can ask me
technical questions directly.

> implemented in imap-4.4/c-client.

Two things: first, use imap-4.5 instead of imap-4.4:
	ftp://ftp.cac.washington.edu/mail/imap-4.5.BETA.tar.Z
imap-4.4 had a bug which broken SEARCH HEADER.

Second, mail_search() is only a jacket to emulate the old function from the
imap-3.x toolkit, and it only supports IMAP2 SEARCH operations.  SEARCH HEADER
is new in IMAP4.  So, you have to use the new interface, which is to build a
SEARCHPGM (instead of a char* string with IMAP protocol) and then call
mail_search_full().  [The mail_search() jacket is a macro just calls a routine
that parses the char* string into a SEARCHPGM, then calls mail_search_full().]

> for this purpose, but strange enough it's not used at all in the whole code.

That's because you call it, in the course of building your SEARCHPGM.  Look at
imapd.c to see how to do this.

The mail_search() jacket will never be extended to cover IMAP4 search
criteria.  It is for compatibility with old softwareonly.  Use the new
mail_search_full() interface instead.