public String getSubject(MimeMessage mimeMessage) {
        String subject = null;
        String addr = "";
        try {
            subject = mimeMessage.getSubject();
            InternetAddress[] address = (InternetAddress[]) mimeMessage.getFrom();
            if (address[0] != null)
                addr = address[0].toString();
        } catch (MessagingException e) {
        }

        if (subject == null)
            subject = "";
        try {
            if (subject.startsWith("=?")) {
                subject = MimeUtility.decodeText(subject);
            } else {
                // subject = MimeUtility.decodeText(subject);
                // byte[] b = subject.getBytes("ISO8859-1");
                if (!addr.startsWith("=?")) {
                    subject = new String(subject.getBytes("ISO8859-1"), "GBK");
                }
            }
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return subject;
    }