javax.mail.search.RecipientStringTerm Java Examples

The following examples show how to use javax.mail.search.RecipientStringTerm. 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 File: SearchTermBuilder.java    From greenmail with 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 File: MailConnection.java    From hop with 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 File: MailConnection.java    From pentaho-kettle with 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 ) );
  }
}