librelist archives

« back to archive

Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

From:
David Hearst
Date:
2014-01-21 @ 16:18
could not decode message

Re: [mailcore] Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

From:
Hoa V. Dinh
Date:
2014-01-21 @ 16:25
Could you use connectionLogger and show the logs to confirm that the 
ending date is ignored?  
Thanks!

--  
Hoa V. Dinh


On Tuesday, January 21, 2014 at 8:18 AM, David Hearst wrote:

> Hi,
>  
> I’m trying to use [MCOIMAPSearchExpression searchAnd:other:] as a way of
retrieving messages that were sent between two specific dates. However, 
the results I get only seem to reflect the expression passed as “other:”. 
The expression passed into “searchAnd:” appears to be ignored.
>  
>     MCOIMAPSearchExpression * afterStartExpression = 
[MCOIMAPSearchExpression searchSinceDate:self.startDate];
>     MCOIMAPSearchExpression * beforeEndExpression = 
[MCOIMAPSearchExpression searchBeforeDate:self.endDate];
>     MCOIMAPSearchExpression * betweenDatesExpression = 
[MCOIMAPSearchExpression searchAnd:afterStartExpression 
other:beforeEndExpression];
>     MCOIMAPSearchOperation * searchOperation = [self.session 
searchExpressionOperationWithFolder:folder 
expression:betweenDatesExpression];
>     [searchOperation start:^(NSError * error, MCOIndexSet * searchResult) {
>         if (error != nil) {
>             NSLog(@"Error searching server for messages:%@", error);
>         }
>  
>         NSLog(@"search result indexes: %@", searchResult);
>     }
>   
>  
> Is there a trick to using -searchAnd:other: so that the results actually
satisfy both the sub-expressions?
>  
> Thanks, David
>  
>  
> Attachments:  
> - smime.p7s
>  

Re: [mailcore] Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

From:
David Hearst
Date:
2014-01-21 @ 18:48
could not decode message

Re: [mailcore] Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

From:
Hoa V. Dinh
Date:
2014-01-21 @ 19:23
Hi David,  

It’s relying on the server implementation.
It looks like the server has a wrong behavior. You probably need to filter
out the wrong result after you made the request to the server.

Though, it looks like there’s a discrepancy between the date you chose and
the actual date that’s searched. Could you file an issue about it?  

--  
Hoa V. Dinh


On Tuesday, January 21, 2014 at 10:48 AM, David Hearst wrote:

> Sure, here’s the log output. I’m seeing confusing variation in the 
results, depending on the actual dates used, so I’m not sure it’s as 
simple as the “and” expression not being honored. I’m not sure why there’s
a difference between the dates I pass in to create the expressions (logged
right at the beginning of the trace) and the output of the connection 
logger which indicates one day earlier. Regardless, though, I’m getting 
back 4 result messages, three of which are completely outside the range.
>  
> Thanks, David
>  
> 2014-01-21 11:06:21.263 SimplePOP[15413:70b] start date: 2014-01-16 
00:00:00 +0000, end date: 2014-01-17 00:00:00 +0000
> 2014-01-21 11:06:21.433 SimplePOP[15413:5607] * OK [CAPABILITY IMAP4REV1
LITERAL+ SASL-IR LOGIN-REFERRALS AUTH=LOGIN ID] mail85c40 IMAP4rev1 
Bigfoot
> 2014-01-21 11:06:21.434 SimplePOP[15413:5607] 1 LOGIN 
"temp@scattershock.com (mailto:temp@scattershock.com)" kiG8Auds9yAf0ko
> 2014-01-21 11:06:21.513 SimplePOP[15413:5607] 1 OK [CAPABILITY IMAP4REV1
LITERAL+ IDLE NAMESPACE UNSELECT SORT ID] User temp@scattershock.com 
(mailto:temp@scattershock.com) authenticated
> 2014-01-21 11:06:21.514 SimplePOP[15413:5607] 2 NAMESPACE
> 2014-01-21 11:06:21.588 SimplePOP[15413:5607] * NAMESPACE (("" "/")) NIL NIL
> 2 OK NAMESPACE completed
> 2014-01-21 11:06:21.589 SimplePOP[15413:5607] 3 SELECT INBOX
> 2014-01-21 11:06:21.664 SimplePOP[15413:5607] * 4 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1389124784] UID validity status
> * OK [UIDNEXT 48] Predicted next UID
> * FLAGS (\Answered \Flagged \Deleted \Draft \Seen)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Draft \Seen)] Permanent flags
> 3 OK [READ-WRITE] SELECT completed
> 2014-01-21 11:06:21.664 SimplePOP[15413:5607] 4 UID SEARCH CHARSET utf-8
(SENTSINCE 15-Jan-2014 SENTBEFORE 16-Jan-2014)
> 2014-01-21 11:06:21.738 SimplePOP[15413:5607] * SEARCH 34 38 39 47
> 4 OK UID SEARCH completed
> 2014-01-21 11:06:21.740 SimplePOP[15413:70b] search result indexes: 34,38-39,47
> 2014-01-21 11:06:21.741 SimplePOP[15413:5607] 5 UID FETCH 34,38:39,47 
(UID BODY.PEEK[HEADER.FIELDS (Date Subject From Sender Reply-To To Cc 
Message-ID References In-Reply-To)])
> 2014-01-21 11:06:21.824 SimplePOP[ 15413:5607] * 1 FETCH (UID 34 
BODY[HEADER.FIELDS (DATE SUBJECT FROM SENDER REPLY-TO TO CC MESSAGE-ID 
REFERENCES IN-REPLY-TO)] {210}
> From: David Hearst <david@darkmoose.com (mailto:david@darkmoose.com)>
> Subject: [Team] Electrofrustrate
> Message-Id: <CE8E8229-6C02-4673-9366-A938DBC32AF4@darkmoose.com 
(mailto:CE8E8229-6C02-4673-9366-A938DBC32AF4@darkmoose.com)>
> Date: Thu, 16 Jan 2014 09:06:25 -0700
> To: temp@scattershock.com (mailto:temp@scattershock.com)
>  
> )
> * 2 FETCH (UID 38 BODY[HEADER.FIELDS (DATE SUBJECT FROM SENDER REPLY-TO 
TO CC MESSAGE-ID REFERENCES IN-REPLY-TO)] {208}
> From: David Hearst <david@blackpixel.com (mailto:david@blackpixel.com)>
> Subject: [Team] Electroparty
> Message-Id: <61B9BEAA-C5CC-4103-9560-FBC1B80333AC@blackpixel.com 
(mailto:61B9BEAA-C5CC-4103-9560-FBC1B80333AC@blackpixel.com)>
> Date: Mon, 20 Jan 2014 11:05:53 -0700
> To: temp@scattershock.com (mailto:temp@scattershock.com)< /b>
>  
> )
> * 3 FETCH (UID 39 BODY[HEADER.FIELDS (DATE SUBJECT FROM SENDER REPLY-TO 
TO CC MESSAGE-ID REFERENCES IN-REPLY-TO)] {194}
> From: David Hearst <david@here4.us (mailto:david@here4.us)>
> Subject: [Team] Electrobux
> Message-Id: <38E92030-3A7A-4972-9E7F-1898E423ED2E@here4.us 
(mailto:38E92030-3A7A-4972-9E7F-1898E423ED2E@here4.us)>
> Date: Mon, 20 Jan 2014 11:06:28 -0700
> To: temp@scattershock.com (mailto:temp@scattershock.com)
>  
> )
> * 4 FETCH (UID 47 BODY[HEADER.FIELDS (DATE SUBJECT FROM SENDER REPLY-TO 
TO CC MESSAGE-ID REFERENCES IN-REPLY-TO)] {216}
> From: KGLT Loud Rock <loudrock@davidhearst.com 
(mailto:loudrock@davidhearst.com)>
> Subject: [Team] Electroscruge
> Message-Id: <97238FA5-FC91-4575-98C5-41D7A4745E7C@davidhearst.com 
(mailto:97238FA5-FC91-4575-98C5-41D7A4745E7C@davidhearst.com)>
> Date: Mon, 20 Jan 2014 16:39:46 -0700
> To: temp@scattershock.com (mailto:temp@scattershock.com)
>  
> )
> 5 OK UID FETCH completed
> 2014-01-21 11:06:21.828 SimplePOP[15413:70b] sent date: 2014-01-16 
16:06:25 +0000, received date: 2014-01-16 16:06:25 +0000
> 2014-01-21 11:06:21.829 SimplePOP[15413:70b] sent date: 2014-01-20 
18:05:53 +0000, received date: 2014-01-20 18:05:53 +0000
> 2014-01-21 11:06:21.829 SimplePOP[15413:70b] sent date: 2014-01-20 
18:06:28 +0000, received date: 2014-01-20 18:06:28 +0000
> 2014-01-21 11:06:21.829 SimplePOP[15413:70b] sent date: 2014-01-20 
23:39:46 +0000, received date: 2014-01-20 23:39:46 +0000
>  
>  
>  
> On Jan 21, 2014, at 9:25 AM, Hoa V. Dinh <dinh.viet.hoa@gmail.com 
(mailto:dinh.viet.hoa@gmail.com)> wrote:
> > Could you use connectionLogger and show the logs to confirm that the 
ending date is ignored?  
> > Thanks!
> >  
> > --  
> > Hoa V. Dinh
> >  
> >  
> > On Tuesday, January 21, 2014 at 8:18 AM, David Hearst wrote:
> >  
> > > Hi,
> > >  
> > > I’m trying to use [MCOIMAPSearchExpression searchAnd:other:] as a 
way of retrieving messages that were sent between two specific dates. 
However, the results I get only seem to reflect the expression passed as 
“other:”. The expression passed into “searchAnd:” appears to be ignored.
> > >  
> > >     MCOIMAPSearchExpression * afterStartExpression = 
[MCOIMAPSearchExpression searchSinceDate:self.startDate];
> > >     MCOIMAPSearchExpression * beforeEndExpression = 
[MCOIMAPSearchExpression searchBeforeDate:self.endDate];
> > >     MCOIMAPSearchExpression * betweenDatesExpression = 
[MCOIMAPSearchExpression searchAnd:afterStartExpression 
other:beforeEndExpression];
> > >     MCOIMAPSearchOperation * searchOperation = [self.session 
searchExpressionOperationWithFolder:folder 
expression:betweenDatesExpression];
> > >     [searchOperation start:^(NSError * error, MCOIndexSet * searchResult) {
> > >         if (error != nil) {
> > >             NSLog(@"Error searching server for messages:%@", error);
> > >         }
> > >  
> > >         NSLog(@"search result indexes: %@", searchResult);
> > >     }
> > >   
> > >  
> > > Is there a trick to using -searchAnd:other: so that the results 
actually satisfy both the sub-expressions?
> > >  
> > > Thanks, David
> > >  
> > >  
> > > Attachments:  
> > > - smime.p7s
> > >  
> > >  
> >  
> >  
>  
>  
> Attachments:  
> - smime.p7s
>  

Re: [mailcore] Trick to using [MCOIMAPSearchExpression searchAnd:other:] ?

From:
David Hearst
Date:
2014-01-21 @ 19:25
could not decode message