Page MenuHomePhorge

Wrong CAPABILITY response on STARTTLS port
Closed, SpitePublic

Description

When a client connects to port 143 and is configured to issue a STARTTLS command, Guam responds with a CAPABILITY response that is the configured backend's response either after implicit SSL (doesn't contain STARTTLS) or explicit STARTTLS (doesn't contain STARTTLS either).

The client however requires a CAPABILITY response with STARTTLS (probably a minimal CAPABILITY response).

Response from vanilla IMAP server:

$ imtest -t "" -u vanmeeuwen -a vanmeeuwen kolab.kolabsys.com
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE STARTTLS LOGINDISABLED] kolab02.kolabsys.com Cyrus IMAP 2.5.5.5-Kolab-2.5.5-5.1.el6.kolab_14 server ready
C: S01 STARTTLS
S: S01 OK Begin TLS negotiation now
verify error:num=19:self signed certificate in certificate chain
TLS connection established: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
C: C01 CAPABILITY
S: * CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxten QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ SORT=DISPLAY SORT=UID THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE ANNOTATE-EXPERIMENT-1 LIST-EXTENDED LIST-STATUS LIST-MYRIGHTS WITHIN QRESYNC SCAN XLIST XMOVE MOVE SPECIAL-USE CREATE-SPECIAL-USE URLAUTH URLAUTH=BINARY X-NETSCAPE AUTH=PLAIN AUTH=LOGIN SASL-IR COMPRESS=DEFLATE X-QUOTA=STORAGE X-QUOTA=MESSAGE X-QUOTA=X-ANNOTATION-STORAGE X-QUOTA=X-NUM-FOLDERS IDLE
S: C01 OK Completed
Please enter your password: 

Response from Guam

$ imtest -t "" -u vanmeeuwen -a vanmeeuwen 172.17.42.1
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxten QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ SORT=DISPLAY SORT=UID THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE ANNOTATE-EXPERIMENT-1 LIST-EXTENDED LIST-STATUS LIST-MYRIGHTS WITHIN QRESYNC SCAN XLIST XMOVE MOVE SPECIAL-USE CREATE-SPECIAL-USE URLAUTH URLAUTH=BINARY X-NETSCAPE AUTH=PLAIN AUTH=LOGIN SASL-IR COMPRESS=DEFLATE X-QUOTA=STORAGE X-QUOTA=MESSAGE X-QUOTA=X-ANNOTATION-STORAGE X-QUOTA=X-NUM-FOLDERS IDLE]   server ready
failure: STARTTLS not supported by the server!

Details

Ticket Type
Task

Event Timeline

vanmeeuwen assigned this task to seigo.
vanmeeuwen raised the priority of this task from to 60.
vanmeeuwen updated the task description. (Show Details)
vanmeeuwen added a project: Guam.
vanmeeuwen moved this task to Backlog on the Guam board.
vanmeeuwen changed Ticket Type from Task to Task.
vanmeeuwen subscribed.
NOTE: Also LOGINDISABLED is omitted from the CAPABILITY response to the client.

That's actually the point of the tls=starttls backend option.

To get the behaviour you are expecting / looking for is starttls passthrough, which is actually how it did work at one point ... I will add this back so when the server backend is tls=false then the client STARTTLS will trigger a STARTTLS on the backend, which will then give the correct sets of capabilities/server ids