search failure

Ross Boylan ross at biostat.ucsf.edu
Fri Sep 16 02:32:20 EDT 2011


On Thu, 2011-09-15 at 16:31 -0700, Ross Boylan wrote:
> Querying a Cyrus 2.2.13 server on a Debian Lenny system (via python's 
> imaplib) I get the following failure after about 50 successful queries 
> that are similar.  Can anyone help me understand what the problem is?
> 
> error: SEARCH command error: BAD ['Missing required argument to Search 
> header']
> 
> The search command used
> (HEADER SUBJECT "Re: Worst Admin Mistake? was --> Re: /usr broken, will 
> the machine
>   reboot ?" HEADER DATE "Wed, 14 Sep 2011 21:53:00 -0400" HEADER FROM 
> "reidac at bellatlantic.net")
> 
> I previously discovered the using the entire field of the original from 
> (including the textual name and angle brackets around the edress) always 
> failed to match.  Any insights into that would be great too.
> 
> Background: I read messages off of Google's IMAP server and then 
> searched for them in my local mailbox to see if they had been 
> forwarded.  Not all were.
> 
> Thanks.
> Ross

I think the problem is the line break after "machine" in the subject
(actually \r\n).  This got taken to be the end of the command, which it
isn't.  I'm not sure if there's a way to get around that from python; at
the raw protocol level one could provide a prefix count of the octets.

As a work-around I truncated the subject string before the end of the
first line.  That seems to suffice.

Still wondering about the problems with edresses.  On further
examination of the spec it doesn't look as if < or > are special in the
context of a quoted string in a search command.

Ross



More information about the Info-cyrus mailing list