Bug 162175 - Does not recognise/use the port number set in the smtp account settings dialog
Summary: Does not recognise/use the port number set in the smtp account settings dialog
Status: RESOLVED FIXED
Alias: None
Product: kdepimlibs
Classification: Applications
Component: mailtransport (show other bugs)
Version: 4.1
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-16 17:58 UTC by mps
Modified: 2010-07-21 11:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: Fixed since at least 4.3 I think.


Attachments
Wireshark capture file (packet data) showing that kmail does not use the port number set in the configuration dialog. (154.79 KB, text/plain)
2008-07-14 14:33 UTC, mps
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mps 2008-05-16 17:58:30 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          4.1.2.33 
OS:                Linux

I am using a local smtp server (see www.uuplus.com) that listens on port 1025 to relay my mail.

In kmail, if I go to Configure - Accounts - Sending and enter hostname: localhost and port: 1025, then click 'Check what the server supports', kmail does not contact the server (no trace in Wireshark) and the 'Use sendmail' button is highlighted. Clicking 'ok' and 'apply' has no effect - the account is added, but kmail just doesn't react when I send mail using that account.

Remote smtp servers work fine. Using 127.0.0.1 instead of localhost produces the same problem.


This is my hosts file:
[user@mycomputer ~]$ cat /etc/hosts
127.0.0.1       localhost.localdomain   localhost       mycomputer
::1     localhost.localdomain   localhost       mycomputer


NB uuplus also has a pop sever on port 1110 and kmail works fine with that.

thanks a lot for your help
M.
Comment 1 mps 2008-06-03 21:29:48 UTC
Note that this is a problem with the smtp server on localhost, not with the uuplus smtp programme. If I run uuplus smtp on another machine (physical or virtual), kmail connects just fine.
Comment 2 mps 2008-07-14 14:32:26 UTC
I'm no C++ expert, but from a bit of grepping in src/kdepim/kmail , it looks 
like the POP seetings dialog has code like this:

  mServerTest->setPort( encryptionType, mPop.ui.portEdit->value() )

where it is setting the port based on the value in the UI.

On the other hand, the smtp equivalent (eg in AccountWizard::smtpCapabilities) 
just has :

  mTransport->setPort( useSSL ? 465 : 25 );

ie the port number is hardcoded to 465 or 25 depending on whether SSL is 
requested or not and it doesn't refer to the port number selected manually in 
the text box in the UI at all.

Am I on the right track here?

Looks like there is similar  stuff for Imap (eg: account->setPort( useSSL ? 993 
: 143 );) so anyone trying to use a non-standard port is out of luck.


cheers
M.
Comment 3 mps 2008-07-14 14:32:39 UTC
To try and work out what is going on here, I fired up wireshark. With the host 
set to 'localhost' and the portnumber set to 1025 in the kmail accounts - smtp 
dialog, I click on 'check what the server supports'. The attached wireshark 
packet file shows the traffic generated. I'm not an expert but it looks like 
kmail is not using the port number that is set in the options dialog, but 
simply defaulting to the standard port 25.

If I run the uuplus server on standard port 25 (requires running as root, which 
I don't want to do as a matter of course) then kmail connects without a problem.

So it is clearly kmail not using the correct port number that creates the 
problem.

I did this test with revision 830974.

Thanks
M.
Comment 4 mps 2008-07-14 14:33:14 UTC
Created attachment 26110 [details]
Wireshark capture file (packet data) showing that kmail does not use the port number set in the configuration dialog.