Package org.apache.mailet

Examples of org.apache.mailet.MailetConfig


    protected String mailAttribute = "org.apache.james.SMIMEDecrypt";
   
    public void init() throws MessagingException {
        super.init();
       
        MailetConfig config = getMailetConfig();
       
        String privateStoreType = config.getInitParameter("keyStoreType");
       
        String privateStoreFile = config.getInitParameter("keyStoreFileName");
        if (privateStoreFile == null) throw new MessagingException("No keyStoreFileName specified");
       
        String privateStorePass = config.getInitParameter("keyStorePassword");
       
        String keyAlias= config.getInitParameter("keyAlias");
        String keyPass = config.getInitParameter("keyAliasPassword");
       
        String mailAttributeConf = config.getInitParameter("mailAttribute");
        if (mailAttributeConf != null) mailAttribute = mailAttributeConf;
       
        try {
            keyHolder = new SMIMEKeyHolder(privateStoreFile, privateStorePass, keyAlias, keyPass, privateStoreType);
        } catch (IOException e) {
View Full Code Here


        super();

    }

    public void init() throws MessagingException {
        MailetConfig config = getMailetConfig();

        String stripSignatureConf = config.getInitParameter("strip");
        if (stripSignatureConf != null) stripSignature = Boolean.valueOf(stripSignatureConf);
       
        String onlyTrustedConf = config.getInitParameter("onlyTrusted");
        if (onlyTrustedConf != null) onlyTrusted = Boolean.valueOf(onlyTrustedConf);
       
        String mailAttributeConf = config.getInitParameter("mailAttribute");
        if (mailAttributeConf != null) mailAttribute = mailAttributeConf;
       
       
        String type = config.getInitParameter("keyStoreType");
        String file = config.getInitParameter("keyStoreFileName");
        String password = config.getInitParameter("keyStorePassword");
       
        try {
            if (file != null) trustedCertificateStore = new KeyStoreHolder(file, password, type);
            else {
                log("No trusted store path specified, using default store.");
View Full Code Here

                    }
                    if (mailet != null && matcher != null) {
                        MailetManagement wrappedMailet = new MailetManagement(mailet);
                        MatcherManagement wrappedMatcher = new MatcherManagement(matcher);
                        String onMatchException = null;
                        MailetConfig mailetConfig = wrappedMailet.getMailetConfig();
                   
                        if (mailetConfig instanceof MailetConfigImpl) {
                            onMatchException = ((MailetConfigImpl) mailetConfig).getInitAttribute("onMatchException");
                        }
                   
View Full Code Here

    protected String mailAttribute = "org.apache.james.SMIMEDecrypt";
   
    public void init() throws MessagingException {
        super.init();
       
        MailetConfig config = getMailetConfig();
       
        String privateStoreType = config.getInitParameter("keyStoreType");
       
        String privateStoreFile = config.getInitParameter("keyStoreFileName");
        if (privateStoreFile == null) throw new MessagingException("No keyStoreFileName specified");
       
        String privateStorePass = config.getInitParameter("keyStorePassword");
       
        String keyAlias= config.getInitParameter("keyAlias");
        String keyPass = config.getInitParameter("keyAliasPassword");
       
        String mailAttributeConf = config.getInitParameter("mailAttribute");
        if (mailAttributeConf != null) mailAttribute = mailAttributeConf;
       
        try {
            keyHolder = new SMIMEKeyHolder(privateStoreFile, privateStorePass, keyAlias, keyPass, privateStoreType);
        } catch (IOException e) {
View Full Code Here

        super();

    }

    public void init() throws MessagingException {
        MailetConfig config = getMailetConfig();

        String stripSignatureConf = config.getInitParameter("strip");
        if (stripSignatureConf != null) stripSignature = Boolean.valueOf(stripSignatureConf).booleanValue();
       
        String onlyTrustedConf = config.getInitParameter("onlyTrusted");
        if (onlyTrustedConf != null) onlyTrusted = Boolean.valueOf(onlyTrustedConf).booleanValue();
       
        String mailAttributeConf = config.getInitParameter("mailAttribute");
        if (mailAttributeConf != null) mailAttribute = mailAttributeConf;
       
       
        String type = config.getInitParameter("keyStoreType");
        String file = config.getInitParameter("keyStoreFileName");
        String password = config.getInitParameter("keyStorePassword");
       
        try {
            if (file != null) trustedCertificateStore = new KeyStoreHolder(file, password, type);
            else {
                log("No trusted store path specified, using default store.");
View Full Code Here

        aliasingMailet = new UsersRepositoryAliasingForwarding();
        aliasingMailet.setUsersRepository(usersRepository);
        aliasingMailet.setUsersStore(usersStore);
        aliasingMailet.init(getMailetConfig());
        sieveMailet = new SieveMailet();
        MailetConfig m = new MailetConfig() {

            /**
             * @see org.apache.mailet.MailetConfig#getInitParameter(java.lang.String)
             */
            public String getInitParameter(String name) {
View Full Code Here

                            wrappedMatcher = new MatcherManagement(matcher);
                        }
                       
                       
                        String onMatchException = null;
                        MailetConfig mailetConfig = wrappedMailet.getMailetConfig();
                   
                        if (mailetConfig instanceof MailetConfigImpl) {
                            onMatchException = ((MailetConfigImpl) mailetConfig).getInitAttribute("onMatchException");
                        }
                   
View Full Code Here

        try {
            mailet.service(mail);
        } catch (MessagingException me) {
            String onMailetException = null;
           
            MailetConfig mailetConfig = mailet.getMailetConfig();
            if (mailetConfig instanceof MailetConfigImpl) {
                onMailetException = ((MailetConfigImpl) mailetConfig).getInitAttribute("onMailetException");
            }
            if (onMailetException == null) {
                onMailetException = Mail.ERROR;
View Full Code Here

        Mailet mailet = m_jamesMailetLoader.getMailet(mailetName, configuration);
        assertTrue("MailetLoaderTestMailet mailet is expected class", mailet instanceof MailetLoaderTestMailet);
        MailetLoaderTestMailet mailetLoaderTestMailet = ((MailetLoaderTestMailet) mailet);
        assertTrue("init was called by loader", mailetLoaderTestMailet.assertInitCalled());
        MailetConfig mailetConfig = mailetLoaderTestMailet.getMailetConfig();
        assertEquals("init was called w/ right config", "testMailetValue", mailetConfig.getInitParameter("testMailetKey"));
    }
View Full Code Here

     *
     */
    @SuppressWarnings("unchecked")
    public String[] getMailetParameters() {
        List<String> parameterList = new ArrayList<String>();
        MailetConfig mailetConfig = getMailet().getMailetConfig();
        Iterator<String> iterator = mailetConfig.getInitParameterNames();
        while (iterator.hasNext()) {
            String name = (String) iterator.next();
            String value = mailetConfig.getInitParameter(name);
            parameterList.add(name + "=" + value);
        }
        String[] result = (String[]) parameterList.toArray(new String[] {});
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.mailet.MailetConfig

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.