javaencodingcharacter-encodingcontent-dispositionmutt

java process builder execute mutt command with subject and attachment name having non-ascii characters


If I directly use mutt command from my terminal I can see that subject is ?UTF-8B?base64_encoded(subject)?= and for my attachment content-disposition header will be attachment; filename*=UTF-8''UTF-8_encoded_filename. This all works fine.

But when I send this mail from java process builder, without setting any header values or any encoding just simply providing subject, to_mail values there is encoding issues, subject will be like ?unkown-8bit?B?wrong_base64_encoded(subject) the encoded subject is wrong, so while decoding there will be question marks for some characters and for attachment value of content-disposition header attachment; filename*=us-ascii''UTF-8_encoded_filename. So while the filename will be full of non human readable characters.

So, how can I set the correct encoding for the subject and also how to mention the correct encoding in the content-disposition header.


Solution

  • Issue got resolved after running mutt command with -e set charset=utf8.