EHLO keyword contains invalid character
See original GitHub issueChecklist
- I have used the search function to see if someone else has already submitted the same bug report.
- I will describe the problem with as much detail as possible.
App version
d13352a4cd7f5ea540eba738155ff377ee48da62 - 2205202769770bc37feb98414bb8a1ae084b9c98
Where did you get the app from?
Other
Android version
11 (LineageOS for microG)
Device model
Fairphone 3
Steps to reproduce
- Set up an email account
- Go to outgoing server settings
- Fill in everything and click next
SMTP server: <REDACTED>
Security: SSL/TLS
Port: 465
Require sign-in: Yes
Username: <REDACTED>
Authentication: Normal password
Password: <REDACTED>
Client certificate: No client certificate
Note: This happens on my own self-hosted mailserver, not on a public provider. I obviously don’t want to make authentication info for it public, but if it helps to debug please send me an email and I’ll get you some login credentials.
Expected behavior
Succesfully set up SMTP, like it did on K-9 Mail v6.000
Actual behavior
An error message shows:
Setup could not finish
Cannot connect to server. (EHLO keyword contains invalid character) [ Continue ] [ Edit Details ]
Logs
Using git bisect, I was able to pinpoint it to the following commit:
d13352a4cd7f5ea540eba738155ff377ee48da62 is the first bad commit
commit d13352a4cd7f5ea540eba738155ff377ee48da62
Author: cketti <cketti@gmail.com>
Date: Wed Mar 23 04:07:37 2022 +0100
Use new `SmtpResponseParser` in `SmtpTransport`
.../smtp/EnhancedNegativeSmtpReplyException.java | 12 +-
.../fsck/k9/mail/transport/smtp/SmtpResponse.kt | 3 +
.../fsck/k9/mail/transport/smtp/SmtpTransport.java | 268 +++++++--------------
.../k9/mail/transport/smtp/StatusCodeClass.java | 12 -
.../k9/mail/transport/smtp/StatusCodeDetail.java | 80 ------
.../k9/mail/transport/smtp/StatusCodeSubject.java | 31 ---
.../k9/mail/transport/smtp/SmtpTransportTest.java | 8 +-
7 files changed, 100 insertions(+), 314 deletions(-)
delete mode 100644 mail/protocols/smtp/src/main/java/com/fsck/k9/mail/transport/smtp/StatusCodeDetail.java
delete mode 100644 mail/protocols/smtp/src/main/java/com/fsck/k9/mail/transport/smtp/StatusCodeSubject.java
Please note: In the attached log file, I replaced the mailserver identification with mail.example.com
and the Hello’s hostname and IP with <REDACTED>
.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
With that option enabled Postfix seems to add a syntactically invalid keyword (starting with
AUTH=
):https://github.com/vdukhovni/postfix/blob/abf156923c91c8c4f2bbd1a591114eb45bb77e81/postfix/src/smtpd/smtpd.c#L1952-L1953
The server’s response to the
EHLO
command starts with:PIPE_CONNECT
contains an underscore, which is not allowed. See https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.1It looks like this is a known issue that hasn’t received much attention: https://www.mail-archive.com/exim-users@exim.org/msg56497.html
I’d prefer for this to be fixed in exim rather than working around the issue in K-9 Mail. When I rewrote the SMTP response parser, I made it throw an error rather than ignore protocol violations to uncover cases like this – so that the code can be fixed.
Unfortunately, it will be a while before I have time to work on trying to get the issue fixed in exim. Given that this involves changing the keyword
PIPE_CONNECT
to something else, maybe you could get the ball rolling by starting a discussion with the exim developers. If not a lot of people are using the extension, a name change could be relatively simple. If the extension has a significant number of users, a migration strategy might be required.