AUTH PLAIN LOGIN ohne STARTTLS

  • Hallo,

    warum bietet qmail aus der SE von pd-admin "AUTH LOGIN PLAIN" ohne STARTTLS an?

    Code
    xxx@xxx:~$ { printf 'EHLO test\r\n'; sleep 1; printf 'QUIT\r\n'; } |timeout 10 nc server01.virtualhosts.de 25 |grep -E '^[0-9]{3}[- ]'
    220 server01.virtualhosts.de ESMTP
    250-server01.virtualhosts.de
    250-STARTTLS
    250-AUTH LOGIN PLAIN
    250-AUTH=LOGIN PLAIN
    250-PIPELINING
    250 8BITMIME
    221 server01.virtualhosts.de
    Code
    xxx@xxx:~$ { printf 'EHLO test\r\n'; sleep 1; printf 'QUIT\r\n'; } |timeout 10 openssl s_client -starttls smtp -connect server01.virtualhosts.de:25 -servername server01.virtualhosts.de -quiet 2>&1 |grep -E '^[0-9]'
    250 8BITMIME
    250-server01.virtualhosts.de
    250-AUTH LOGIN PLAIN
    250-AUTH=LOGIN PLAIN
    250-PIPELINING
    250 8BITMIME
    221 server01.virtualhosts.de

    Das Gleiche beim Port 587.


    Sollte/müsste es nicht so sein wie bei web.de?

    Code
    xxx@xxx:~$ { printf 'EHLO test\r\n'; sleep 1; printf 'QUIT\r\n'; } |timeout 10 nc smtp.web.de 25 |grep -E '^[0-9]{3}[- ]' 
    220 web.de (mrweb006) Nemesis ESMTP Service ready
    250-web.de Hello test [91.xxx.xxx.xxx]
    250-8BITMIME
    250-SIZE 141557760
    250 STARTTLS
    221 web.de Service closing transmission channel
    Code
    xxx@xxx:~$ { printf 'EHLO test\r\n'; sleep 1; printf 'QUIT\r\n'; } |timeout 10 openssl s_client -starttls smtp -connect smtp.web.de:25 -servername smtp.web.de -quiet 2>&1 |grep -E '^[0-9]'
    250 STARTTLS
    250-web.de Hello test [91.xxx.xxx.xxx]
    250-8BITMIME
    250-AUTH PLAIN LOGIN
    250 SIZE 141557760
    221 web.de Service closing transmission channel

    Also das "AUTH PLAIN LOGIN" erst bei STARTTLS erscheint.

    Im rfc4954 steht dazu folgendes:

    Note: A server implementation MUST implement a configuration in which it does NOT permit any plaintext password mechanisms, unless either the STARTTLS [SMTP-TLS] command has been negotiated or some other mechanism that protects the session from password snooping has been provided. Server sites SHOULD NOT use any configuration which permits a plaintext password mechanism without such a protection mechanism against password snooping.

    To ensure interoperability, client and server implementations of this extension MUST implement the [PLAIN] SASL mechanism running over TLS [TLS] [SMTP-TLS]. See also Section 15 for additional requirements on implementations of [PLAIN] over [TLS].

    Modern implementations SHOULD NOT advertise mechanisms that are not permitted due to lack of encryption, unless an encryption layer of sufficient strength is currently being employed.


    Besteht die Möglichkeit, das AUTH PLAIN erst zu senden, wenn STARTTLS aktiv ist?

  • Vanilla qmail konnte gar kein AUTH oder STARTTLS. Dies kam mit Patches rein. Ein solches Verhalten müsste also per Patch rein kommen.

    Seit 2014 unterstützt qmail FORCETLS als Variable. Damit ist AUTH erst möglich wenn auf eine verschlüsselte Verbindung gewechselt wurde. PoC:

    Es wird zwar immer noch AUTH gesendet, ohne ein Wechsel auf STARTTLS wird dies aber nicht akzeptiert.

    btw: Die Tests Eingangs mit "openssl s_client -starttls ... " sind sinnfrei, da dabei automatisch auf eine STARTTLS Verbindung gewechselt wird:

    -starttls protocol

    Send the protocol-specific message(s) to switch to TLS for communication.

    Dies zeigt somit nicht das bemängelte Verhalten.