Inherits from NSObject
Declared in MCOIMAPSearchExpression.h
MCOIMAPSearchExpression.mm

Overview

Used to construct an IMAP search query

Class Methods

searchAll

Creates a search expression that returns all UIDS for the mailbox

+ (MCOIMAPSearchExpression *)searchAll

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAll]

Declared In

MCOIMAPSearchExpression.h

searchAnd:other:

Creates a search expression that’s a disjunction of two search expressions.

+ (MCOIMAPSearchExpression *)searchAnd:(MCOIMAPSearchExpression *)expression other:(MCOIMAPSearchExpression *)other

Discussion

Example:

 MCOIMAPSearchExpression * exprFrom = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"]
 MCOIMAPSearchExpression * exprSubject = [MCOIMAPSearchExpression searchContent:@"meeting"]
 MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAnd:exprFrom other:exprSubject];

*

Declared In

MCOIMAPSearchExpression.h

searchAnswered

Creates a search expression that matches messages that have the answered flag set.

+ (MCOIMAPSearchExpression *)searchAnswered

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAnswered] *

Declared In

MCOIMAPSearchExpression.h

searchBcc:

Creates a search expression that matches on the bcc field of an email. Useful to check whether the mail is addressed to the receiver as bcc.

+ (MCOIMAPSearchExpression *)searchBcc:(NSString *)value

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBcc:@“ngan@etpan.org”] *

Declared In

MCOIMAPSearchExpression.h

searchBeforeDate:

Creates a search expression that matches messages sent before a date.

+ (MCOIMAPSearchExpression *)searchBeforeDate:(NSDate *)date

Discussion

Example:

NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBeforeDate:yesterday] *

Declared In

MCOIMAPSearchExpression.h

searchBeforeReceivedDate:

Creates a search expression that matches messages received before a date.

+ (MCOIMAPSearchExpression *)searchBeforeReceivedDate:(NSDate *)date

Discussion

Example:

NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBeforeReceivedDate:yesterday] *

Declared In

MCOIMAPSearchExpression.h

searchBody:

Creates a search expression that matches the content of an email, excluding the headers.

+ (MCOIMAPSearchExpression *)searchBody:(NSString *)value

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBody:@“building”]

Declared In

MCOIMAPSearchExpression.h

searchCc:

Creates a search expression that matches on the cc of an email. Useful to check whether the mail is addressed to the receiver as cc.

+ (MCOIMAPSearchExpression *)searchCc:(NSString *)value

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchCc:@“ngan@etpan.org”] *

Declared In

MCOIMAPSearchExpression.h

searchContent:

Creates a search expression that matches the content of an email, including the headers.

+ (MCOIMAPSearchExpression *)searchContent:(NSString *)value

Discussion

Example:

 MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchContent:@"meeting"]

Declared In

MCOIMAPSearchExpression.h

searchDeleted

Creates a search expression that matches messages that are deleted.

+ (MCOIMAPSearchExpression *)searchDeleted

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchDeleted] *

Declared In

MCOIMAPSearchExpression.h

searchDraft

Creates a search expression that matches draft messages.

+ (MCOIMAPSearchExpression *)searchDraft

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchDraft] *

Declared In

MCOIMAPSearchExpression.h

searchFlagged

Creates a search expression that matches messages that have been flagged.

+ (MCOIMAPSearchExpression *)searchFlagged

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchFlagged] *

Declared In

MCOIMAPSearchExpression.h

searchFrom:

Creates a search expression that matches the sender of an email.

+ (MCOIMAPSearchExpression *)searchFrom:(NSString *)value

Discussion

Example:

 MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"]

Declared In

MCOIMAPSearchExpression.h

searchGmailMessageID:

Creates a search expression that matches emails with the given gmail message id

+ (MCOIMAPSearchExpression *)searchGmailMessageID:(uint64_t)number

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailMessageID:aMessageID]

Declared In

MCOIMAPSearchExpression.h

searchGmailRaw:

Creates a search expression that gets emails that match a gmail raw search expression.

+ (MCOIMAPSearchExpression *)searchGmailRaw:(NSString *)expr

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailRaw:@“from:bill has:attachment filename:cal meeting schedule”]

Declared In

MCOIMAPSearchExpression.h

searchGmailThreadID:

Creates a search expression that matches emails with the given gmail thread id

+ (MCOIMAPSearchExpression *)searchGmailThreadID:(uint64_t)number

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailThreadID:aThreadID]

Declared In

MCOIMAPSearchExpression.h

searchHeader:value:

Creates a search expression that matches the content of a specific header.

+ (MCOIMAPSearchExpression *)searchHeader:(NSString *)header value:(NSString *)value

Discussion

Example:

 MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchHeader:@"List-Id" value:@"shoes"]

*

Declared In

MCOIMAPSearchExpression.h

searchNot:

Creates a search expression that matches when the argument is not matched.

+ (MCOIMAPSearchExpression *)searchNot:(MCOIMAPSearchExpression *)expression

Discussion

Example:

MCOIMAPSearchExpression * exprSubject = [MCOIMAPSearchExpression searchSubject:@“airline”] MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchNot:exprSubject]; The expression will match when the subject does not contain the word airline

Declared In

MCOIMAPSearchExpression.h

searchOnDate:

Creates a search expression that matches messages sent on a date.

+ (MCOIMAPSearchExpression *)searchOnDate:(NSDate *)date

Discussion

Example:

NSDate *now = [NSDate date]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOnDate:now] *

Declared In

MCOIMAPSearchExpression.h

searchOnReceivedDate:

Creates a search expression that matches messages received on a date.

+ (MCOIMAPSearchExpression *)searchOnReceivedDate:(NSDate *)date

Discussion

Example:

NSDate *now = [NSDate date]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOnReceivedDate:now] *

Declared In

MCOIMAPSearchExpression.h

searchOr:other:

Creates a search expression that’s a conjunction of two search expressions.

+ (MCOIMAPSearchExpression *)searchOr:(MCOIMAPSearchExpression *)expression other:(MCOIMAPSearchExpression *)other

Discussion

Example:

 MCOIMAPSearchExpression * exprFrom = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"]
 MCOIMAPSearchExpression * exprOtherFrom = [MCOIMAPSearchExpression searchRecipient:@"ngan@etpan.org"]
 MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOr:exprFrom exprOtherFrom];

Declared In

MCOIMAPSearchExpression.h

searchRead

Creates a search expression that matches messages with the Read flag.

+ (MCOIMAPSearchExpression *)searchRead

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchRead] *

Declared In

MCOIMAPSearchExpression.h

searchRecipient:

Creates a search expression that matches any recipient of an email.

+ (MCOIMAPSearchExpression *)searchRecipient:(NSString *)value

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchRecipient:@“ngan@etpan.org”] *

Declared In

MCOIMAPSearchExpression.h

searchSinceDate:

Creates a search expression that matches messages sent since a date.

+ (MCOIMAPSearchExpression *)searchSinceDate:(NSDate *)date

Discussion

Example:

NSDate *now = [NSDate date]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSinceDate:now] *

Declared In

MCOIMAPSearchExpression.h

searchSinceReceivedDate:

Creates a search expression that matches messages received since a date.

+ (MCOIMAPSearchExpression *)searchSinceReceivedDate:(NSDate *)date

Discussion

Example:

NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSinceReceivedDate:yesterday] *

Declared In

MCOIMAPSearchExpression.h

searchSizeLargerThan:

Creates a search expression that matches messages larger than a given size in bytes.

+ (MCOIMAPSearchExpression *)searchSizeLargerThan:(uint32_t)size

Discussion

Example:

uint32_t minSize = 1024 * 10; // 10 KB MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSizeLargerThan:minSize] *

Declared In

MCOIMAPSearchExpression.h

searchSizeSmallerThan:

Creates a search expression that matches messages smaller than a given size in bytes.

+ (MCOIMAPSearchExpression *)searchSizeSmallerThan:(uint32_t)size

Discussion

Example:

uint32_t maxSize = 1024 * 10; // 10 KB MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSizeSmallerThan:maxSize] *

Declared In

MCOIMAPSearchExpression.h

searchSpam

Creates a search expression that matches messages that are spam.

+ (MCOIMAPSearchExpression *)searchSpam

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSpam] *

Declared In

MCOIMAPSearchExpression.h

searchTo:

Creates a search expression that matches on the receiver (to) of an email. Useful to check whether the mail is directly addressed to the receiver.

+ (MCOIMAPSearchExpression *)searchTo:(NSString *)value

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchTo:@"ngan@etpan.org"]

*

Declared In

MCOIMAPSearchExpression.h

searchUIDs:

Creates a search expression that matches the uids specified.

+ (MCOIMAPSearchExpression *)searchUIDs:(MCOIndexSet *)uids

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUids:uids] *

Declared In

MCOIMAPSearchExpression.h

searchUnanswered

Creates a search expression that matches messages that don’t have the answered flag set..

+ (MCOIMAPSearchExpression *)searchUnanswered

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnanswered] *

Declared In

MCOIMAPSearchExpression.h

searchUndraft

Creates a search expression that matches messages that aren’t drafts.

+ (MCOIMAPSearchExpression *)searchUndraft

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUndraft] *

Declared In

MCOIMAPSearchExpression.h

searchUnflagged

Creates a search expression that matches messages that haven’t been flagged.

+ (MCOIMAPSearchExpression *)searchUnflagged

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnflagged] *

Declared In

MCOIMAPSearchExpression.h

searchUnread

Creates a search expression that matches messages without the Read flag.

+ (MCOIMAPSearchExpression *)searchUnread

Discussion

Example:

MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnread] *

Declared In

MCOIMAPSearchExpression.h