Package mireka

Examples of mireka.ConfigurationException


            try {
                message.setFrom(new InternetAddress(from));
                message.setRecipient(RecipientType.TO, new InternetAddress(
                        recipient));
            } catch (AddressException e) {
                throw new ConfigurationException(e);
            }
            message.setSubject(subject, "UTF-8");
            message.setText("");
            return message;
        } catch (MessagingException e) {
View Full Code Here


        mail.from = reversePath;
        try {
            mail.recipients.add(new MailAddressFactory()
                    .createRecipient(recipient));
        } catch (ParseException e) {
            throw new ConfigurationException(e);
        }

        mail.mailData =
                new MimeMessageConverter()
                        .createMailDataInSmtpSession(mimeMessage);
View Full Code Here

    public void setRecipient(String recipient) {
        try {
            this.recipient =
                    new MailAddressFactory().createRecipient(recipient);
        } catch (ParseException e) {
            throw new ConfigurationException();
        }
    }
View Full Code Here

            File actualKeystoreFile = getActualKeystoreFile();
            try {
                in = new FileInputStream(actualKeystoreFile);
                keyStore.load(in, keystorePass.toCharArray());
            } catch (IOException e) {
                throw new ConfigurationException("Cannot open keyfile "
                        + actualKeystoreFile, e);
            } finally {
                if (in != null) {
                    in.close();
                }
            }
            logger.debug("Key store size: " + keyStore.size());
            keyManagerFactory.init(keyStore, keystorePass.toCharArray());
            KeyManager[] keyManagers = keyManagerFactory.getKeyManagers();
            sslContext.init(keyManagers, null, null);
            socketFactory = sslContext.getSocketFactory();
        } catch (IOException e) {
            throw new ConfigurationException(e);
        } catch (GeneralSecurityException e) {
            throw new ConfigurationException(e);
        }

    }
View Full Code Here

            Destination destination;
            Recipient canonicalRecipient = recipient;
            int lookups = 0;
            while (true) {
                if (lookups > 10) {
                    throw new ConfigurationException(
                            "Recipient aliases may created a loop for "
                                    + recipient);
                }
                destination =
                        recipientDestinationMapper.lookup(canonicalRecipient);
View Full Code Here

     * @throws ConfigurationException
     *             if no destination is assigned yet
     */
    public Destination getDestination() throws ConfigurationException {
        if (destination == null)
            throw new ConfigurationException(
                    "Destination is not assigned to recipient " + recipient
                            + " yet, this is likely caused by "
                            + "wrong configuration");
        return destination;
    }
View Full Code Here

    private void checkResponsibilityHasBeenTakenForAllRecipients()
            throws ConfigurationException {
        for (RecipientContext recipientContext : mailTransaction.recipientContexts) {
            if (!recipientContext.isResponsibilityTransferred) {
                throw new ConfigurationException("Processing of mail data "
                        + "completed, but no filter has took the "
                        + "responsibility for the recipient "
                        + recipientContext.recipient + ", "
                        + "whose assigned destination was "
                        + recipientContext.getDestination());
View Full Code Here

    }

    private String calculateHash(String source) {
        try {
            if (secretKey == null)
                throw new ConfigurationException(
                        "SRS Secret key is not configured.");
            byte[] sourceBytes =
                    source.toLowerCase(Locale.US).getBytes("UTF-8");
            Mac mac = Mac.getInstance("HmacSHA1");
            Key key = new SecretKeySpec(secretKey, "HmacSHA1");
View Full Code Here

     */
    public void setSecretKey(String secretKey) {
        try {
            this.secretKey = Hex.decodeHex(secretKey.toCharArray());
        } catch (DecoderException e) {
            throw new ConfigurationException(
                    "Invalid secret key: " + secretKey, e);
        }
    }
View Full Code Here

        }

        private RemotePart calculateRewrittenRemotePart() {
            if (originalRecipient.isGlobalPostmaster()) {
                if (defaultRemotePart == null)
                    throw new ConfigurationException(
                            "Mails sent to the global Postmaster are "
                                    + "forwarded, but "
                                    + "no default domain is specified "
                                    + "which can be used in SRS.");
                return defaultRemotePart;
            }

            RemotePartContainingRecipient remotePartContainingRecipient =
                    (RemotePartContainingRecipient) originalRecipient;
            RemotePart recipientRemotePart =
                    remotePartContainingRecipient.getMailbox().getRemotePart();
            if (localDomains == null
                    || localDomains.isSatisfiedBy(recipientRemotePart)) {
                return recipientRemotePart;
            } else {
                if (defaultRemotePart == null)
                    throw new ConfigurationException(
                            "The domain of a forwarded address does not "
                                    + "authorizes this server to send mail, "
                                    + "and no default domain is defined "
                                    + "which can be used in SRS.");
                return defaultRemotePart;
View Full Code Here

TOP

Related Classes of mireka.ConfigurationException

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.