Package mireka.transmission

Examples of mireka.transmission.Mail


            mail.scheduleDate = mail.arrivalDate;
            for (Map.Entry<ResponsibleDestination, DestinationState> entry : destinations
                    .entrySet()) {
                ResponsibleDestination destination = entry.getKey();
                DestinationState destinationState = entry.getValue();
                Mail destinationMail = mail.copy();
                List<RecipientContext> recipientContexts =
                        destinationState.recipientContexts;
                for (RecipientContext recipientContext : recipientContexts) {
                    destinationMail.recipients.add(recipientContext.recipient);
                }
View Full Code Here


        }
    }

    private void sendMail(Mail srcMail, MimeMessage mimeMessage)
            throws RejectExceptionExt {
        Mail mail = new Mail();
        mail.from = reversePath;
        try {
            mail.recipients.add(new MailAddressFactory()
                    .createRecipient(recipient));
        } catch (ParseException e) {
View Full Code Here

        props.setInt("deliveryAttempts", mail.deliveryAttempts);
        props.setInt("postpones", mail.postpones);
    }

    public Mail readFromProperties(DataProperties props) {
        Mail mail = new Mail();
        mail.from =
                new MailAddressFactory().createReversePathAlreadyVerified(props
                        .getString("from"));
        mail.recipients =
                props.getList("recipients",
View Full Code Here

    }

    @Override
    public void run() {
        logger.debug("Processing mail named " + mailName + "...");
        Mail mail;
        try {
            mail = dir.read(mailName);
        } catch (QueueStorageException e) {
            logger.error("Cannot read mail. Mail will remain in the queue, "
                    + "but it won't be retried until the "
View Full Code Here

            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e); // impossible
            } finally {
                propertiesStream.close();
            }
            Mail mail =
                    new MailEnvelopePersister().readFromProperties(properties);

            File mailDataFile = new File(dir, mailName.contentFileName());
            mail.mailData = new FileMailData(mailDataFile);
            return mail;
View Full Code Here

        List<List<Recipient>> recipientsByDomain =
                groupRecipientsByDomain(mail.recipients);
        if (recipientsByDomain.isEmpty())
            throw new IllegalArgumentException("No recipients");
        for (List<Recipient> recipients : recipientsByDomain) {
            Mail mailToSingleDomain = mail.copy();
            mailToSingleDomain.recipients.clear();
            mailToSingleDomain.recipients.addAll(recipients);
            queue.add(mailToSingleDomain);
        }
        logger.debug("Mail addressed to {} domains was added to queue: {}",
View Full Code Here

                logger.debug("Failure or delay, but reverse-path is null, "
                        + "DSN must not be sent. "
                        + "Original mail itself was a notification.");
                return;
            }
            Mail dsnMail = dsnMailCreator.create(mail, reports);
            dsnTransmitter.transmit(dsnMail);
            logger.debug("DSN message is created with "
                    + permanentFailureReports.size()
                    + " permanent failures and " + delayReports.size()
                    + " delays and passed to the DSN transmitter.");
View Full Code Here

        if (members.isEmpty()) {
            logger.debug("Forward list has no members, dropping mail");
            return;
        }

        Mail mail = srcMail.copy();
        mail.recipients.clear();
        for (Member member : members) {
            if (member.isDisabled())
                continue;
            mail.recipients.add(member.getRecipient());
View Full Code Here

public class DsnMailCreatorTest {

    @Test
    public void testCreate() throws Exception {
        DsnMailCreator dsnMailCreator = createDsnMailCreator();
        Mail mail = ExampleMail.simple();
        List<RecipientProblemReport> recipientStatuses =
                createRecipientFailure();
        Mail dsnMail = dsnMailCreator.create(mail, recipientStatuses);

        writeToFileForDebugging(dsnMail.mailData);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        dsnMail.mailData.writeTo(out);
        byte[] bytes = out.toByteArray();
View Full Code Here

public class DnsMailCreatorLargeOriginalTest {
    @Test
    public void testLongMail() throws Exception {
        DsnMailCreator dsnMailCreator =
                DsnMailCreatorTest.createDsnMailCreator();
        Mail mail = ExampleMail.veryLong();
        List<RecipientProblemReport> recipientStatuses =
                DsnMailCreatorTest.createRecipientFailure();
        Mail dsnMail = dsnMailCreator.create(mail, recipientStatuses);

        File file =
                new File(System.getProperty("java.io.tmpdir"), getClass()
                        .getSimpleName() + ".eml");
        FileOutputStream fout = new FileOutputStream(file);
View Full Code Here

TOP

Related Classes of mireka.transmission.Mail

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.