]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/POP3.pm
pop3: advertise STLS in CAPA if appropriate
[public-inbox.git] / lib / PublicInbox / POP3.pm
index 2c20c84b0e1022f6594227d8de9f1a4cb2aaf4fb..ec73893c5694d6cdda85ad5d3739d4c910c21d69 100644 (file)
@@ -343,15 +343,17 @@ sub cmd_dele {
 # RFC 2449
 sub cmd_capa {
        my ($self) = @_;
+       my $STLS = !$self->{ibx} && !$self->{sock}->can('stop_SSL') &&
+                       $self->{pop3d}->{accept_tls} ? "\nSTLS\r" : '';
        $self->{expire} = ''; # "EXPIRE 0" allows clients to avoid DELE commands
-       \<<EOM;
+       <<EOM;
 +OK Capability list follows\r
 TOP\r
 USER\r
 PIPELINING\r
 UIDL\r
 EXPIRE 0\r
-RESP-CODES\r
+RESP-CODES\r$STLS
 .\r
 EOM
 }