Bug 175892

Summary: sending mail fails due to spurious newline in server name configuration
Product: [Applications] kdepimlibs Reporter: Peter Sabaini <peter>
Component: mailtransportAssignee: Tom Albers <toma>
Status: RESOLVED FIXED    
Severity: normal CC: jtamate, kdepim-bugs
Priority: NOR Keywords: triaged
Version: 4.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Peter Sabaini 2008-11-23 15:49:49 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

Probably because I copy-pasted the Servername into the dialog, the config file ended up with a literal '\n' at the end of the servername:

% grep host .kde/share/config/mailtransports
host=smtp.tele2.at\n

KMail is unable to send any mail with this config; after opening mailtransports in an editor and removing the literal \n it works. 

Whitespace chars should probably be filtered out before writing the configuration.
Comment 1 Peter Sabaini 2008-11-23 15:55:12 UTC
Also, the error message is a bit unhelpful -- I just get:

Sending failed:
smtp://user:pass@smtp.tele2.at
:587/send?headers=0&from=peter%40sabaini.at&to=peter%40sabaini.at&size=375

Comment 2 Jaime Torres 2008-11-25 11:41:38 UTC
Confirmed in kmail 1.10.90 svn trunk r888112 in the outgoing accounts.
Comment 3 Tom Albers 2008-11-25 19:21:08 UTC
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.
BUG: 175892


 M  +1 -1      smtpjob.cpp  
 M  +3 -0      transport.cpp  
 M  +12 -1     transportconfigdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=888995