Example usage for javax.mail.internet MimePart removeHeader

List of usage examples for javax.mail.internet MimePart removeHeader

Introduction

In this page you can find the example usage for javax.mail.internet MimePart removeHeader.

Prototype

public void removeHeader(String header_name) throws MessagingException;

Source Link

Document

Remove all headers with this name.

Usage

From source file:com.zimbra.cs.mime.Mime.java

public static void repairTransferEncoding(MimePart mp) throws MessagingException {
    if (isZimbraJavaMailShim(mp)) {
        return;//from   www. j  a v  a 2  s .co  m
    }

    String cte = mp.getHeader("Content-Transfer-Encoding", null);
    String ct = getContentType(mp);
    if (cte != null && (!TRANSFER_ENCODINGS.contains(cte.toLowerCase().trim())
            || ct.startsWith(MimeConstants.CT_MULTIPART_PREFIX) || ct.equals(MimeConstants.CT_MESSAGE_RFC822)))
        mp.removeHeader("Content-Transfer-Encoding");
}