backport SVN commit 888995 by toma:
Make sure the hostname does not end with a \n. Strip it on input and strip it on retrieval. Thanks for your bug report.
svn path=/branches/KDE/4.1/kdepimlibs/; revision=893121