Continuing my javamail exploration and headbanging on the wall I've encounter another problem.

The incoming mails with attachments might have the attachment filename in Greek language. So all the attachments that i get have its filename in ISO and not UTF-8 encoding. So the greek name is really messed up. I tried to handle the error and change the filename when it's not recognised but i can't get the extension of the attachment cause the original filename is invalid.

Any idea how can i handle this problem? I'm stuck with this for about 2 days and can't find out anything. I tried to set the incoming, message or part, encoding type to UTF-8 but i didn't manage to achiev this.

Thanks in advance..