Package javax.mail.internet

Examples of javax.mail.internet.MimeMessage.removeHeader()


                storeMail(mail.getSender(), recipient, mail);

                if (deliveryHeader != null) {
                    if (i.hasNext()) {
                        // Remove headers but leave all placeholders
                        message.removeHeader(deliveryHeader);
                        headers = deliveredTo.getAllHeaders();
                        // And restore any original Delivered-To headers
                        while (headers.hasMoreElements()) {
                            Header header = (Header) headers.nextElement();
                            message.addHeader(header.getName(), header
View Full Code Here


            }

            //Create a copy of this message to send out
            MimeMessage message = new MimeMessage(mail.getMessage());
            //We need to remove this header from the copy we're sending around
            message.removeHeader(RFC2822Headers.RETURN_PATH);

            //Figure out the listserv address.
            MailAddress listservAddr = getListservAddress();
            if (listservAddr == null) {
                //Use the recipient
View Full Code Here

            if (mail != null) {
                // if the previous e-mail was sent for a success, this new e-mail
                // is not a follow up
                AbstractBuild<?, ?> pb = build.getPreviousBuild();
                if(pb!=null && pb.getResult()==Result.SUCCESS) {
                    mail.removeHeader("In-Reply-To");
                    mail.removeHeader("References");
                }

                Address[] allRecipients = mail.getAllRecipients();
                if (allRecipients != null) {
View Full Code Here

                // if the previous e-mail was sent for a success, this new e-mail
                // is not a follow up
                AbstractBuild<?, ?> pb = build.getPreviousBuild();
                if(pb!=null && pb.getResult()==Result.SUCCESS) {
                    mail.removeHeader("In-Reply-To");
                    mail.removeHeader("References");
                }

                Address[] allRecipients = mail.getAllRecipients();
                if (allRecipients != null) {
                    StringBuilder buf = new StringBuilder("Sending e-mails to:");
View Full Code Here

            // Store the content type for later use
            messageContentType = message.getContentType();

            // Remove the erroneous headers from the message
            // @todo ideally identified from the device repository
            message.removeHeader("Message-ID");
            message.removeHeader("Mime-Version");
            message.removeHeader("Content-Type");

            // Before anything is written to the output stream make sure that
            // the response content type is set.
View Full Code Here

            messageContentType = message.getContentType();

            // Remove the erroneous headers from the message
            // @todo ideally identified from the device repository
            message.removeHeader("Message-ID");
            message.removeHeader("Mime-Version");
            message.removeHeader("Content-Type");

            // Before anything is written to the output stream make sure that
            // the response content type is set.
            //
View Full Code Here

            // Remove the erroneous headers from the message
            // @todo ideally identified from the device repository
            message.removeHeader("Message-ID");
            message.removeHeader("Mime-Version");
            message.removeHeader("Content-Type");

            // Before anything is written to the output stream make sure that
            // the response content type is set.
            //
            // The message content type will always be of the form:
View Full Code Here

        try {
            // Create a copy of this message to send out
            MimeMessage outgoingMessage =
                    new MimeMessage(mail.getMimeMessage());
            // We need to remove this header from the copy we're sending around
            outgoingMessage.removeHeader("Return-Path");

            // Check if the X-been-there header is set to the listserv's name
            // (the address). If it has, this means it's a message from this
            // listserv that's getting bounced back, so we need to swallow it
            if (address.toString().equals(
View Full Code Here

            // getting sent back out to the list
            outgoingMessage.setHeader("X-been-there", address.toString());

            outgoingMessage.setHeader("List-Id", "<" + listId + ">");
            outgoingMessage.setHeader("List-Post", "<" + address + ">");
            outgoingMessage.removeHeader("List-Help");
            outgoingMessage.removeHeader("List-Unsubscribe");
            outgoingMessage.removeHeader("List-Subscribe");
            outgoingMessage.removeHeader("List-Owner");
            outgoingMessage.removeHeader("List-Archive");
View Full Code Here

            outgoingMessage.setHeader("X-been-there", address.toString());

            outgoingMessage.setHeader("List-Id", "<" + listId + ">");
            outgoingMessage.setHeader("List-Post", "<" + address + ">");
            outgoingMessage.removeHeader("List-Help");
            outgoingMessage.removeHeader("List-Unsubscribe");
            outgoingMessage.removeHeader("List-Subscribe");
            outgoingMessage.removeHeader("List-Owner");
            outgoingMessage.removeHeader("List-Archive");

            return outgoingMessage;
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.