Bug 398036 - Password for sending mails not used when specified via password prompt
Summary: Password for sending mails not used when specified via password prompt
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.9.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-29 21:12 UTC by Jan Hambrecht
Modified: 2018-08-31 07:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.9.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hambrecht 2018-08-29 21:12:27 UTC
When the smtp password is not saved in the smtp settings dialog kmail prompts for a password just before sending a mail. When debugging the ksmtp component I discovered that an empty password is sent to the server. When I set the smtp password to be stored in the settings dialog, the password is sent correctly to the server and sending mails works again.
Comment 1 Laurent Montel 2018-08-30 06:53:12 UTC
Hi,
How do you want that it works ?

Perhaps I need to disable password lineedit when we don't store password.
IT's more logical as it's never stored no ?
Comment 2 Jan Hambrecht 2018-08-30 10:39:38 UTC
Yes it is probably sensible to disable the lineedit in the settings dialog if the store password option is unchecked.

In any case if kmail asks the user for a password via the password prompt popping up before sending, it should be used for authentication on the mail server. Otherwise there is no point asking the user for a password, isn't it? This used to work in older versions and just stopped working in the last kmail version.
Comment 3 Laurent Montel 2018-08-30 11:50:17 UTC
Git commit 325d0e03480ee756713eccdcffe19a09c44daff2 by Laurent Montel.
Committed on 30/08/2018 at 11:49.
Pushed by mlaurent into branch 'Applications/18.08'.

Disable password lineedit when we don't store password

M  +14   -1    src/kmailtransport/plugins/smtp/smtpconfigwidget.cpp
M  +1    -0    src/kmailtransport/plugins/smtp/smtpconfigwidget.h

https://commits.kde.org/kmailtransport/325d0e03480ee756713eccdcffe19a09c44daff2
Comment 4 Jan Hambrecht 2018-08-30 13:08:29 UTC
Looking at src/kmailtransport/plugins/smtp/smtpjob.cpp it seems the password from the password dialog is only set to the transport but not to the login job (see line 290). Probably because of the XOAUTH2 handling in line 286.
Comment 5 Laurent Montel 2018-08-31 06:46:51 UTC
Git commit 6c0464d203066cddadc9383867d6d585b0e613f4 by Laurent Montel.
Committed on 31/08/2018 at 06:46.
Pushed by mlaurent into branch 'Applications/18.08'.

Fix Bug 398036 - Password for sending mails not used when specified via password prompt

Thanks Jan Hambrecht for debugging
FIXED-IN: 5.9.1

M  +3    -2    src/kmailtransport/plugins/smtp/smtpjob.cpp

https://commits.kde.org/kmailtransport/6c0464d203066cddadc9383867d6d585b0e613f4
Comment 6 Luca Beltrame 2018-08-31 07:15:23 UTC
Note that you also need https://commits.kde.org/kmailtransport/6656ae1449c8743243391d15dca41a912e2aecd3 in case you need to patch it yourself due to a small error that cropped up in the previous commit.
Comment 7 Jan Hambrecht 2018-08-31 07:38:26 UTC
Many thanks and great work!