Package org.apache.mailet

Examples of org.apache.mailet.MailetException


    public void init() throws MessagingException {
        super.init();
        try {
            setScriptURL(new URL(getInitParameter("scriptURL")));
        } catch (MalformedURLException e) {
            throw new MailetException(
                    "Error in configuration parameter \"scriptURL\"", e);
        }
    }
View Full Code Here


            }

            reply.setContent(multipart);
            reply.setHeader(RFC2822Headers.CONTENT_TYPE, multipart.getContentType());
        } catch (IOException ioe) {
            throw new MailetException("Unable to create multipart body");
        }

        //Create the list of recipients in our MailAddress format
        Set recipients = new HashSet();
        recipients.add(getMailetContext().getPostmaster());
View Full Code Here

     */
    public void init() throws MailetException {
        attributeName = getInitParameter(ATTRIBUTE_PARAMETER_NAME);

        if (attributeName == null) {
            throw new MailetException(ATTRIBUTE_PARAMETER_NAME
                    + " is a mandatory parameter");
        }

        log("RecoverAttachment is initialised with attribute [" + attributeName
                + "]");
View Full Code Here

            MimeMessage message = null;
            try {
                message = mail.getMessage();
            } catch (MessagingException e) {
                throw new MailetException(
                        "Could not retrieve message from Mail object", e);
            }

            Iterator i = attachments.values().iterator();
            try {
View Full Code Here

       
        try {
            FlowedMessageUtils.flowMessage(mail.getMessage(), optionFlowedDelsp, optionWidth);
           
        } catch (MessagingException e) {
            throw new MailetException("Could not wrap message", e);
           
        } catch (IOException e) {
            throw new MailetException("Could not wrap message", e);
        }
       
    }
View Full Code Here

     * @return an array containing Pattern and Substitution of the input stream
     * @throws MailetException
     */
    protected static Object[] getPattern(String line) throws MailetException {
        String[] pieces = StringUtils.split(line, "/");
        if (pieces.length < 3) throw new MailetException("Invalid expression: " + line);
        int options = 0;
        //if (pieces[2].indexOf('x') >= 0) options += Pattern.EXTENDED;
        if (pieces[2].indexOf('i') >= 0) options += Pattern.CASE_INSENSITIVE;
        if (pieces[2].indexOf('m') >= 0) options += Pattern.MULTILINE;
        if (pieces[2].indexOf('s') >= 0) options += Pattern.DOTALL;
View Full Code Here

        return new Object[] {Pattern.compile(pieces[0], options), pieces[1] , new Integer(flags)};
    }
   
    protected static List[] getPatternsFromString(String pattern) throws MailetException {
        pattern = pattern.trim();
        if (pattern.length() < 2 && !pattern.startsWith("/") && !pattern.endsWith("/")) throw new MailetException("Invalid parameter value: " + PARAMETER_NAME_SUBJECT_PATTERN);
        pattern = pattern.substring(1, pattern.length() - 1);
        String[] patternArray = StringUtils.split(pattern, "/,/");
       
        List patterns = new ArrayList();
        List substitutions = new ArrayList();
View Full Code Here

       
        String line;
        while ((line = reader.readLine()) != null) {
            line = line.trim();
            if (line.length() > 0 && !line.startsWith("#")) {
                if (line.length() < 2 && !line.startsWith("/") && !line.endsWith("/")) throw new MailetException("Invalid expression: " + line);
                Object[] o = getPattern(line.substring(1, line.length() - 1));
                patterns.add(o[0]);
                substitutions.add(o[1]);
                flags.add(o[2]);
            }
View Full Code Here

            rConfig.bodyFlags = (Integer[]) bodyFlagsList.toArray(new Integer[0]);
           
            return rConfig;
           
        } catch (FileNotFoundException e) {
            throw new MailetException("Failed initialization", e);
           
        } catch (MailetException e) {
            throw new MailetException("Failed initialization", e);
           
        } catch (IOException e) {
            throw new MailetException("Failed initialization", e);
           
        }
    }
View Full Code Here

            }
           
            if (mod) mail.getMessage().saveChanges();
           
        } catch (MessagingException e) {
            throw new MailetException("Error in replace", e);
           
        } catch (IOException e) {
            throw new MailetException("Error in replace", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.mailet.MailetException

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.