On 28/08/2020 01:11, Alec Moskvin wrote:
Hello,

When connecting to Exim 4.94, dovecot submission logs this warning:

   dovecot[25235]: submission(alec)<25347><QNydV8+t+oMKAgAF>: Warning: 
smtp-client: conn localhost:25 ([::1]:25) [1]: Received invalid EHLO response line: 
Unexpected character in EHLO keyword

Looks like it doesn't like the underscore in "X_PIPE_CONNECT", since
it's neither "isalnum" nor a dash [1]:

   1598480923.401085 220 myhostname ESMTP Exim 4.94 Wed, 26 Aug 2020 18:28:43 
-0400
   1598480923.401906 250-myhostname Hello localhost [::1]
   1598480923.401906 250-SIZE 52428800
   1598480923.401906 250-8BITMIME
   1598480923.401906 250-PIPELINING
   1598480923.401906 250-X_PIPE_CONNECT
   1598480923.401906 250-CHUNKING
   1598480923.401906 250-STARTTLS
   1598480923.401906 250 HELP
   1598480923.409242 250 OK
   1598480923.434743 250 Accepted
   1598480923.578335 250- 511 byte chunk, total 511
   1598480923.578335 250 OK id=1kB3uN-0006ar-HU

Adding the line "pipelining_connect_advertise_hosts =" to Exim's config
fixes the issue by disabling X_PIPE_CONNECT.

Is this a bug in Exim or is Dovecot being too strict?

Thanks,
Alec

[1] 
https://github.com/dovecot/core/blob/2.3.11.3/src/lib-smtp/smtp-syntax.c#L250

Dovecot follows the standards as strict as reasonable, with some workarounds for the bad code out there. Exim is in violation of RFC 5321, Section 4.1.1.1:

   ehlo-ok-rsp    = ( "250" SP Domain [ SP ehlo-greet ] CRLF )
                    / ( "250-" Domain [ SP ehlo-greet ] CRLF
                    *( "250-" ehlo-line CRLF )
                    "250" SP ehlo-line CRLF )

   ehlo-greet     = 1*(%d0-9 / %d11-12 / %d14-127)
                    ; string of any characters other than CR or LF

   ehlo-line      = ehlo-keyword *( SP ehlo-param )

   ehlo-keyword   = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
                    ; additional syntax of ehlo-params depends on
                    ; ehlo-keyword

   ehlo-param     = 1*(%d33-126)
                    ; any CHAR excluding <SP> and all
                    ; control characters (US-ASCII 0-31 and 127
                    ; inclusive)


The underscore is not supported by the standard (only dash).

Is Exim doing this by default? In that case we may need to add a workaround for 
it.

Regards,

Stephan.

Reply via email to