/** * The match method. * * @param msg The pattern search is applied on this Message's body * @return true if the pattern is found; otherwise false */ public boolean match(Message msg) { return matchPart(msg); }
/** * Defines filter on a message body. * All parts of the message that are of MIME type "text/*" are searched. * * @param pattern String pattern use in body. * @return this */ public EmailFilter text(final String pattern) { final SearchTerm term = new BodyTerm(pattern); concat(term); return this; }
protected Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
protected Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
/** * The match method. * * @param msg The pattern search is applied on this Message's body * @return true if the pattern is found; otherwise false */ @Override public boolean match(Message msg) { return matchPart(msg); }
/** * append IMAP search term information from a BodyTerm item. * * @param term The source BodyTerm * @param charset target charset for the search information (can be null). */ protected void appendBody(BodyTerm term, String charset) throws MessagingException { appendAtom("BODY"); appendString(term.getPattern(), charset); }
/** * Search all messages with body containing the word bodyfilter * * @param bodyfilter * @param notTerm * negate condition */ public void setBodyTerm( String bodyfilter, boolean notTerm ) { if ( !Utils.isEmpty( bodyfilter ) ) { if ( notTerm ) { addSearchTerm( new NotTerm( new BodyTerm( bodyfilter ) ) ); } else { addSearchTerm( new BodyTerm( bodyfilter ) ); } } }
private static Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
/** * Defines filter on a message body. * All parts of the message that are of MIME type "text/*" are searched. * * @param pattern String pattern use in body. * @return this */ public EmailFilter text(final String pattern) { final SearchTerm term = new BodyTerm(pattern); concat(term); return this; }
private static Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
public SearchTermBuilder body(Op op, String pattern) { SearchTerm st = new BodyTerm(pattern); addTerm(op, st); return this; }
/** * The match method. * * @param msg The pattern search is applied on this Message's body * @return true if the pattern is found; otherwise false */ @Override public boolean match(Message msg) { return matchPart(msg); }
protected Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
Folder mailFolder = store.getFolder(folder); mailFolder.open(Folder.READ_WRITE); SearchTerm st = new AndTerm(new SubjectTerm(subject), new BodyTerm(subject)); Message[] messages = mailFolder.search(st); for (Message message : messages) {
/** * The match method. * * @param msg The pattern search is applied on this Message's body * @return true if the pattern is found; otherwise false */ @Override public boolean match(Message msg) { return matchPart(msg); }
protected Argument body(BodyTerm term, String charset) throws SearchException, IOException { Argument result = new Argument(); result.writeAtom("BODY"); result.writeString(term.getPattern(), charset); return result; }
@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); } };
/** * The match method. * * @param msg The pattern search is applied on this Message's body * @return true if the pattern is found; otherwise false */ @Override public boolean match(Message msg) { return matchPart(msg); }