manifoldcf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cihad Guzel <cguz...@gmail.com>
Subject Re: email connector filtering
Date Mon, 16 Jan 2017 11:10:47 GMT
Hi Karl,

I looked the email connector code lines but the "date"  is not being used
for filtering. I think it should be added. I created an issue :
https://issues.apache.org/jira/browse/CONNECTORS-1368
and create a PR from github: https://github.com/apache/manifoldcf/pull/15

Regards
Cihad Guzel



2017-01-15 14:20 GMT+03:00 Cihad Guzel <cguzelg@gmail.com>:

> Thanks Karl for your information.
>
> Regards
> Cihad Guzel
>
> 2017-01-14 23:41 GMT+03:00 Karl Wright <daddywri@gmail.com>:
>
>> Hi Cihad,
>>
>> The email connector uses the standard email java class to search.  Here's
>> the code for constructing that search:
>>
>> >>>>>>
>>     SearchTerm searchTerm = null;
>>
>>     Iterator<Map.Entry<String,String>> it =
>> findMap.entrySet().iterator();
>>     while (it.hasNext()) {
>>       Map.Entry<String,String> pair = it.next();
>>       findParameterName = pair.getKey().toLowerCase(Locale.ROOT);
>>       findParameterValue = pair.getValue();
>>       if (Logging.connectors.isDebugEnabled())
>>         Logging.connectors.debug("Email: Finding emails where '" +
>> findParameterName +
>>             "' = '" + findParameterValue + "'");
>>       SearchTerm searchClause = null;
>>       if (findParameterName.equals(EmailConfig.EMAIL_SUBJECT)) {
>>         searchClause = new SubjectTerm(findParameterValue);
>>       } else if (findParameterName.equals(EmailConfig.EMAIL_FROM)) {
>>         searchClause = new FromStringTerm(findParameterValue);
>>       } else if (findParameterName.equals(EmailConfig.EMAIL_TO)) {
>>         searchClause = new RecipientStringTerm(Message.RecipientType.TO,
>> findParameterValue);
>>       } else if (findParameterName.equals(EmailConfig.EMAIL_BODY)) {
>>         searchClause = new BodyTerm(findParameterValue);
>>       }
>>
>>       if (searchClause != null)
>>       {
>>         if (searchTerm == null)
>>           searchTerm = searchClause;
>>         else
>>           searchTerm = new AndTerm(searchTerm, searchClause);
>>       }
>>       else
>>       {
>>         Logging.connectors.warn("Email: Unknown filter parameter name:
>> '"+findParameterName+"'");
>>       }
>>     }
>> <<<<<<
>>
>> So you construct a search as basically a set of AND clauses, where each
>> AND clause is either a "subject", "from", "to", or "body" match.  What the
>> email java class does with that search I am not sure; I'd play with it a
>> bit to see.
>>
>> Thanks,
>> Karl
>>
>>
>> On Sat, Jan 14, 2017 at 12:02 PM, Cihad Guzel <cguzelg@gmail.com> wrote:
>>
>>> Hi Karl,
>>>
>>> I try email connector. There are some filter field for email as from,
>>> to, body, subject, date. How does the filter works?  What should I write in
>>> this filter inputs, especially the date and body field?
>>>
>>> What is the pattern for the filter fields?
>>> Only year or timestamp or range for date field?
>>> Full text or regex or only one word for the another fields (to, from,
>>> subject, body) ?
>>>
>>> I haven't seen any documents related to this matter. Could you help me?
>>>
>>> --
>>> Thanks
>>> Cihad Guzel
>>>
>>
>>
>
>
> --
> Teşekkürler
> Cihad Güzel
>



-- 
Teşekkürler
Cihad Güzel

Mime
View raw message