Bug 392138

Summary: First SMTP authentication fails for almost every emails
Product: [Applications] kmailtransport Reporter: Thomas Monjalon <thomas>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version: 5.7.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Thomas Monjalon 2018-03-21 15:01:38 UTC
Hi,

I am using KMail 5.7.3 in ArchLinux.
Since recently (not sure about the version number), I have some delay when sending emails.

I tried enabling logs with
kdebugsettings
export KSMTP_SESSION_LOG=/tmp/smtp.log
akonadictl restart


Most of the time, the first send attempt fails:

journalctl:
akonadi_maildispatcher_agent[21670]: org.kde.pim.mailtransport.smtpplugin: Login started
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: TLS negotiation done.
akonadi_maildispatcher_agent[21670]: qt.network.ssl: QSslSocket::startClientEncryption: cannot start handshake on non-plain connection
akonadi_maildispatcher_agent[21670]: qt.network.ssl: QSslSocket::startClientEncryption: cannot start handshake on non-plain connection
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: Socket disconnected
akonadi_maildispatcher_agent[21670]: org.kde.pim.mailtransport.smtpplugin: Removing session KSmtp::Session(0x55e5c5d67ca0) from the pool
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: Socket disconnected

Session log:
C: EHLO xps.localnet
S: 220 smtp.fastmail.com ESMTP ready
S: 220 smtp.fastmail.com ESMTP ready

Notification:
E-Mail Sending Failed
Failed to transport messaged. Connection to server lost.


Then there is an automatic second attempt which works:

journalctl:
akonadi_maildispatcher_agent[21670]: org.kde.pim.mailtransport.smtpplugin: Login started
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: TLS negotiation done.
akonadi_maildispatcher_agent[21670]: qt.network.ssl: QSslSocket::startClientEncryption: cannot start handshake on non-plain connection
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: Trying authmod "PLAIN"
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: SASL_INTERACT Id 16385
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: SASL_INTERACT Id 16386
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: SASL_CB_[USER|AUTHNAME]: ' "john@doe.net" '
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: SASL_INTERACT Id 16388
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: SASL_CB_PASS: [hidden]
akonadi_maildispatcher_agent[21670]: org.kde.pim.ksmtp: Trying authmod "PLAIN"
akonadi_maildispatcher_agent[21670]: org.kde.pim.mailtransport.smtpplugin: Send started

Session log:
C: EHLO xps.localnet
S: 220 smtp.fastmail.com ESMTP ready
S: 250-smtp.fastmail.com
S: 250-PIPELINING
...
Comment 1 Thomas Monjalon 2018-04-04 12:51:58 UTC
There is a workaround: use STARTTLS.
Comment 2 Justin Zobel 2022-11-18 04:30:39 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 3 Thomas Monjalon 2022-11-18 08:11:47 UTC
I use STARTTLS, so cannot say if the bug is still there without it.
As nobody tried to reproduce after 4 years, closing it.