email - Mail attachment name's encoding issue in javamail, due to difference between RFC 2047 and pre-2047 -


all

recently, building mail system our company.

and here got problem in handling mail attachment name encoding.

the problem in protocol before rfc-2047, size of encoded string should less 75 bytes, , java mail did default.

doencode(string, b64, jcharset,   // per rfc 2047, size of encoded string should not  // exceed 75 bytes.  // 7 = size of "=?", '?', 'b'/'q', '?', "?="  75 - 7 - charset.length(), // available space  "=?" + charset + "?" + encoding + "?", // prefix  true, encodingword, outb); 

but of our customer not recognize kind of attachment' name

the attachment's name looks

=?utf-8?b?abcdefg=?= 

so, manually write function encode them without divide them string less 70 bytes

but again......

some of our other customers can not recognize our attachment name, , "utf-8" name shows again...

my question is: there way can detect kind of protocol customer accept? can choose kind of encoding function can use...


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -