Wednesday, June 17, 2009

Small glitch in the Java Mail API when used in the Linux Environment

I was writing a Java Mail POP3 client recently and was reading both multi part and plain text mails, getting the body text and persisting that text to the database. This worked fine when i tested it in the Windows environment. But when we deployed the application in a Linux environment we saw that the database had one extra blank line coming in between each new line. When we debugged this it came down to the point where we get the body text from the message using the getContent() method provided by the Java Mail API. And in this too it was showing a new line in between each line and hence i had to write a regex to get rid of that extra line before persisting to the database.

Hope this helps anyone else who might face this prob in the future.

No comments:

Post a Comment