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 Sun, 15 Jan 2017 11:20:30 GMT
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

Mime
View raw message