Java Code Examples for javax.mail.search.RecipientStringTerm

The following examples show how to use javax.mail.search.RecipientStringTerm. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: greenmail   Source File: SearchTermBuilder.java    License: Apache License 2.0 6 votes vote down vote up
private static SearchTermBuilder createTextSearchTermBuilder() {
    return new SearchTermBuilder() {
        @Override
        public SearchTerm build() {
            String query = getParameters().get(0);
            SearchTerm[] terms = {
              new RecipientStringTerm(Message.RecipientType.TO, query),
              new RecipientStringTerm(Message.RecipientType.CC, query),
              new RecipientStringTerm(Message.RecipientType.BCC, query),
              new FromStringTerm(query),
              new SubjectTerm(query),
              new BodyTerm(query)
            };
            return new OrTerm(terms);
        }
    };
}
 
Example 2
Source Project: hop   Source File: MailConnection.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Set filter on receipient.
 *
 * @param receipient messages will be filtered on receipient
 */
public void setReceipientTerm( String receipient ) {
  if ( !Utils.isEmpty( receipient ) ) {
    addSearchTerm( new RecipientStringTerm( Message.RecipientType.TO, receipient ) );
  }
}
 
Example 3
Source Project: pentaho-kettle   Source File: MailConnection.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Set filter on receipient.
 *
 * @param receipient
 *          messages will be filtered on receipient
 */
public void setReceipientTerm( String receipient ) {
  if ( !Utils.isEmpty( receipient ) ) {
    addSearchTerm( new RecipientStringTerm( Message.RecipientType.TO, receipient ) );
  }
}