Examples of RejectException


Examples of org.subethamail.smtp.RejectException

                String statusText;
                if (spfResult.getExplanation().isEmpty())
                    statusText = "Blocked by SPF";
                else
                    statusText = "Blocked - see: " + spfResult.getExplanation();
                throw new RejectException(550, statusText);
            } else if (spfResult.equals(SPFErrorConstants.TEMP_ERROR_CONV)) {
                throw new RejectException(451,
                        "Temporarily rejected: Problem on SPF lookup");
            } else if (rejectOnPermanentError
                    && spfResultCode.equals(SPFErrorConstants.PERM_ERROR_CONV)) {
                throw new RejectException(550, "Blocked - invalid SPF record");
            }

            return chain.verifyRecipient(recipientContext);
        }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            wrapped.from(from);
        } catch (RejectException e) {
            throw e;
        } catch (ConfigurationException e) {
            logger.error("Wrong configuration.", e);
            throw new RejectException(554, "Mail server configuration is wrong");
        } catch (RuntimeException e) {
            logger.error("Unexpected exception.", e);
            throw new RejectException(550, "Internal error");
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            wrapped.recipient(recipient);
        } catch (RejectException e) {
            throw e;
        } catch (ConfigurationException e) {
            logger.error("Wrong configuration.", e);
            throw new RejectException(554, "Mail server configuration is wrong");
        } catch (RuntimeException e) {
            logger.error("Unexpected exception.", e);
            throw new RejectException(550, "Internal error");
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            wrapped.data(data);
        } catch (RejectException e) {
            throw e;
        } catch (ConfigurationException e) {
            logger.error("Wrong configuration.", e);
            throw new RejectException(554, "Mail server configuration is wrong");
        } catch (RuntimeException e) {
            logger.error("Unexpected exception.", e);
            throw new RejectException(550, "Internal error");
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            throws RejectException {
        try {
            return new MailAddressFactory().createReversePath(reversePath);
        } catch (ParseException e) {
            logger.debug("Syntax error in reverse path " + reversePath, e);
            throw new RejectException(553, "Syntax error in reverse path "
                    + reversePath);
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            throws RejectException {
        try {
            return new MailAddressFactory().createRecipient(recipient);
        } catch (ParseException e) {
            logger.debug("Syntax error in recipient " + recipient, e);
            throw new RejectException(553, "Syntax error in mailbox name "
                    + recipient);
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

     * Converts this exception to a SubEthaSMTP {@link RejectException}.
     *
     * @return the {@link RejectException} corresponding to this exception.
     */
    public RejectException toRejectException() {
        return new RejectException(reply.getSmtpReplyCode(),
                reply.getMessagePrefixedWithEnhancedStatusCode());
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        try {
            transmitter.transmit(mail);
        } catch (LocalMailSystemException e) {
            logger.warn("Cannot accept mail because of a "
                    + "transmission failure", e);
            throw new RejectException(e.errorStatus().getSmtpReplyCode(), e
                    .errorStatus().getMessagePrefixedWithEnhancedStatusCode());
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            return backend.connect();
        } catch (SMTPException e) {
            throw new BackendRejectException(e,
                    " - Backend rejected connection");
        } catch (IOException e) {
            throw new RejectException(451, e.getMessage());
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        try {
            smartClient.from(from);
        } catch (SMTPException e) {
            throw new BackendRejectException(e, " - Backend rejected sender");
        } catch (IOException e) {
            throw new RejectException(451, e.getMessage());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.