Package org.apache.mailet

Examples of org.apache.mailet.MailAddress.toInternetAddress()


            if (!mailAddress.getDomain().equalsIgnoreCase("address.marker")) {
                newList.add(internetAddress);
            } else if (internetAddress.equals(SpecialAddress.SENDER.toInternetAddress())) {
                MailAddress sender = mail.getSender();
                if (sender != null) {
                    newList.add(sender.toInternetAddress());
                }
            } else if (internetAddress.equals(SpecialAddress.REVERSE_PATH.toInternetAddress())) {
                MailAddress reversePath = mail.getSender();
                if (reversePath != null) {
                    newList.add(reversePath.toInternetAddress());
View Full Code Here


                    newList.add(sender.toInternetAddress());
                }
            } else if (internetAddress.equals(SpecialAddress.REVERSE_PATH.toInternetAddress())) {
                MailAddress reversePath = mail.getSender();
                if (reversePath != null) {
                    newList.add(reversePath.toInternetAddress());
                }
            } else if (internetAddress.equals(SpecialAddress.FROM.toInternetAddress())) {
                try {
                    InternetAddress[] fromArray = (InternetAddress[]) mail.getMessage().getFrom();
                    if (fromArray != null) {
View Full Code Here

                    if (fromArray != null) {
                        Collections.addAll(newList, fromArray);
                    } else {
                        MailAddress reversePath = mail.getSender();
                        if (reversePath != null) {
                            newList.add(reversePath.toInternetAddress());
                        }
                    }
                } catch (MessagingException me) {
                    log("Unable to parse the \"FROM\" header in the original message; ignoring.");
                }
View Full Code Here

                    if (replyToArray != null) {
                        Collections.addAll(newList, replyToArray);
                    } else {
                        MailAddress reversePath = mail.getSender();
                        if (reversePath != null) {
                            newList.add(reversePath.toInternetAddress());
                        }
                    }
                } catch (MessagingException me) {
                    log("Unable to parse the \"REPLY_TO\" header in the original message; ignoring.");
                }
View Full Code Here

            Collection<MailAddress> recipients = mail.getRecipients();
            InternetAddress addr[] = new InternetAddress[recipients.size()];
            int j = 0;
            for (Iterator<MailAddress> i = recipients.iterator(); i.hasNext(); j++) {
                MailAddress rcpt = i.next();
                addr[j] = rcpt.toInternetAddress();
            }

            if (addr.length <= 0) {
                log("No recipients specified... not sure how this could have happened.");
                return true;
View Full Code Here

        InternetAddress[] iaarray = new InternetAddress[1];
        iaarray[0] = SpecialAddress.SENDER.toInternetAddress();
        if (addressList != null) {
            MailAddress specialAddress = getSpecialAddress(addressList, new String[] { "sender", "unaltered", "from" });
            if (specialAddress != null) {
                iaarray[0] = specialAddress.toInternetAddress();
            } else {
                log("\"to\" parameter ignored, set to sender");
            }
        }
        return iaarray;
View Full Code Here

            iaarray = InternetAddress.parse(addressList, false);
            for (int i = 0; i < iaarray.length; ++i) {
                String addressString = iaarray[i].getAddress();
                MailAddress specialAddress = getSpecialAddress(addressString, new String[] { "postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null" });
                if (specialAddress != null) {
                    iaarray[i] = specialAddress.toInternetAddress();
                }
            }
        } catch (Exception e) {
            throw new MessagingException("Exception thrown in getTo() parsing: " + addressList, e);
        }
View Full Code Here

        InternetAddress[] iaarray = new InternetAddress[1];
        iaarray[0] = getMailetContext().getPostmaster().toInternetAddress();
        if (addressList != null) {
            MailAddress specialAddress = getSpecialAddress(addressList, new String[] { "postmaster", "unaltered" });
            if (specialAddress != null) {
                iaarray[0] = specialAddress.toInternetAddress();
            } else {
                log("\"to\" parameter ignored, set to postmaster");
            }
        }
        return iaarray;
View Full Code Here

        if (msg.getRecipients(Message.RecipientType.TO).length == 1) {
            assertEquals(msg.getRecipients(Message.RecipientType.TO)[0].toString(), "b@remote.com");
        } else {
            assertEquals(context.getSendmails().get(0).getRecipients().size(), 1);
            MailAddress rec = context.getSendmails().get(0).getRecipients().iterator().next();
            assertEquals(rec.toInternetAddress().toString(), "b@remote.com");
        }

        assertEquals(mail.getRecipients().size(), 1);
        MailAddress localRec = mail.getRecipients().iterator().next();
        assertEquals(localRec.toInternetAddress().toString(), "a@localhost");
View Full Code Here

            assertEquals(rec.toInternetAddress().toString(), "b@remote.com");
        }

        assertEquals(mail.getRecipients().size(), 1);
        MailAddress localRec = mail.getRecipients().iterator().next();
        assertEquals(localRec.toInternetAddress().toString(), "a@localhost");
    }

}
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.