Advanced Algorithm Mail Sorting
Posted: Wed Jan 19, 2011 10:19 pm
Hello-
I'm looking to this forums expertise in order to structure an algorithm to return messages in a php webmail app similar to apple mail's rule system.
Criteria:
-Unlimited "rules" or sorting criteria
-Example rules "integer ranges" "string matches" "date ranges"
For Example:
Rule 1: Find all messages that were sent between 1/10/2011 AND 1/19/2011
Rule 2: The message sender must contain "@gmail.com"
Rule 3: Sender is NOT in my address book
Rule 4: Message is high priority
Return: X messages
I know how to structure each of these "rules" on an individual basis but would like to use off of them combined in a simple, clean and efficient algorithm.. Rules will vary and may be used in different orders, combinations, quantities etc.
How should I structure something like this? Thanks in advance!!
I'm looking to this forums expertise in order to structure an algorithm to return messages in a php webmail app similar to apple mail's rule system.
Criteria:
-Unlimited "rules" or sorting criteria
-Example rules "integer ranges" "string matches" "date ranges"
For Example:
Rule 1: Find all messages that were sent between 1/10/2011 AND 1/19/2011
Rule 2: The message sender must contain "@gmail.com"
Rule 3: Sender is NOT in my address book
Rule 4: Message is high priority
Return: X messages
I know how to structure each of these "rules" on an individual basis but would like to use off of them combined in a simple, clean and efficient algorithm.. Rules will vary and may be used in different orders, combinations, quantities etc.
How should I structure something like this? Thanks in advance!!