Hi Felix,

Thanks for the report. You’re right: the AUTH=... line in James’s SMTP EHLO
response does not conform to RFC 5321. SMTP AUTH mechanisms should be
advertised as AUTH OAUTHBEARER XOAUTH2 in this example. AUTH=... is likely
an IMAP capability format and does not belong in the SMTP response.

I checked the James code history. This behavior has existed since at least
2015, likely a stale bug. It seems it only happens for SMTP though, other
protocols are fine.

A PR would be very welcome. Thanks for offering to fix it.

Best regards,
Quan

On Mon, Sep 21, 2026 at 9:11 PM Felix Auringer <[email protected]>
wrote:

> Hey,
>
> I noticed that James sends its authentication mechanisms for SMTP twice,
> once with a space and once with an equal sign:
>
> 220 Hello from <my domain>
> ehlo example.internal
> 250-<my domain> Hello example.internal [84.186.194.95])
> 250-AUTH OAUTHBEARER XOAUTH2
> 250-AUTH=OAUTHBEARER XOAUTH2
> 250-PIPELINING
> 250-ENHANCEDSTATUSCODES
> 250 8BITMIME
> ```
>
> As far as I understand, this is not compliant with the RFC (
> https://www.rfc-editor.org/info/rfc5321/#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-line      = ehlo-keyword *( SP ehlo-param )
>
> The only character allowed to follow directly after the ehlo keyword
> (AUTH) is a space.
> I am also not entirely sure whether sending the same ehlo keyword twice is
> allowed.
> We use one client that can not handle the line with the equal sign:
> https://github.com/simonrob/email-oauth2-proxy/blob/6599460ef7ea99a0ca9515d2457d1666cccb965a/emailproxy.py#L2334
> (admittedly, this is an unusual one).
> But other large email servers like Google or Microsoft only announce their
> authentication mechanisms once and without the equal sign.
>
> Is there a reason why you deviate from the standard?
> I would be open to submit a PR making James compliant to RFC 5321.
>
> Best regards,
> Felix
> ---
> Gesellschaft für interkulturelles
> Zusammenleben gGmbH (GIZ)
> Felix Auringer
> IT
> Reformationsplatz 2
> 13597 Berlin
>
> Tel: 030/513 0100 00; Fax: 030/513 0100 09
> www.giz.berlin; [email protected]
>
> Amtsgericht Charlottenburg HRB 200872 B
> Geschäftsführerin: Dr. Britta Marschke
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to