Have you contacted the owner of the mailer creating this garbage? That's really the place to start.
I'm not aware of any existing classes to do this cleanup. If this is the only kind of bad header that you need to deal with it should be straightforward to create your own class that handles just this case.
Thanks for your answer. These emails are comming from different domains (3 that I have seen). Since I don´t know whether there are more or not (probably there are), having a solution in our system would be the best option.
Another problem: so far this has been the only problematic header I need to deal with, but maybe tomorrow comes another one. That means that my class should be expanded. Since mail.mime.contenttypehandler property exists, I assume that I am not the only one who is dealing with this issue, maybe someone has more experience that I do and could give me a hand??
Can you send me an example message that has this problem? (As an attachment, to email@example.com.)
I'm not sure which part of the contenttypehandler you think is difficult. Do you understand how to write the class and the method, but don't understand what to put in the method? Just look for the string "; Content-Transfer-Encoding:" in the content type string and remove it and everything after it.