Package org.apache.jsieve.mail

Examples of org.apache.jsieve.mail.SieveMailException


        String result = null;
        if (mail != null) {
            try {
                result = mail.getContentType();
            } catch (MessagingException e) {
                throw new SieveMailException(e);
            }
        }
        return result;
    }
View Full Code Here


            final Address[] results = builder.getAddresses();
            return results;

        } catch (MessagingException ex) {
           throw new SieveMailException(ex);
        } catch (ParseException ex) {
            throw new SieveMailException(ex);
        }
    }
View Full Code Here

        boolean result = false;
        if (mail != null) {
            try {
                result = mail.getContent().toString().toLowerCase().contains(phraseCaseInsensitive);
            } catch (MessagingException e) {
                throw new SieveMailException(e);
            } catch (IOException e) {
                throw new SieveMailException(e);
            }
        }
        return result;
    }
View Full Code Here

    protected boolean executeBasic(MailAdapter mail, Arguments args,
            SieveContext ctx) throws SieveException {
        // Attempt to fetch content as a string. If we can't do this it's
        // not a message we can handle.
        if (mail.getContentType().indexOf("text/") != 0) {
            throw new SieveMailException("Message is not of type 'text'");
        }
        String body = (String) mail.getContent();
        body = body.toLowerCase();

        // Compare each test string with body, ignoring case
View Full Code Here

    protected boolean executeBasic(MailAdapter mail, Arguments args,
            SieveContext ctx) throws SieveException {
        // Attempt to fetch content as a string. If we can't do this it's
        // not a message we can handle.
        if (mail.getContentType().indexOf("text/") != 0) {
            throw new SieveMailException("Message is not of type 'text'");
        }
        String body = (String) mail.getContent();
        body = body.toLowerCase();

        // Compare each test string with body, ignoring case
View Full Code Here

    protected boolean executeBasic(MailAdapter mail, Arguments args,
            SieveContext ctx) throws SieveException {
        // Attempt to fetch content as a string. If we can't do this it's
        // not a message we can handle.
        if (mail.getContentType().indexOf("text/") != 0) {
            throw new SieveMailException("Message is not of type 'text'");
        }

        // Compare each test string with body, ignoring case
        for (final String phrase:strings.getList()) {
            if (mail.isInBodyText(phrase)) {
View Full Code Here

            String[] headers = getMessage().getHeader(name);
            return (headers == null ? new ArrayList<String>(0) : Arrays.asList(headers));
        }
        catch (MessagingException ex)
        {
            throw new SieveMailException(ex);
        }
    }
View Full Code Here

            }
            return new ArrayList<String>(headerNames);
        }
        catch (MessagingException ex)
        {
            throw new SieveMailException(ex);
        }
    }
View Full Code Here

        {
            return getMessage().getSize();
        }
        catch (MessagingException ex)
        {
            throw new SieveMailException(ex);
        }
    }
View Full Code Here

   
    public String getContentType() throws SieveMailException {
        try {
            return getMessage().getContentType();
        } catch (MessagingException e) {
            throw new SieveMailException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jsieve.mail.SieveMailException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.