Projects
Kolab:16:Enterprise
guam
0001-make-add_starttls_to_capabilities-work-als...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-make-add_starttls_to_capabilities-work-also-on-the-f.patch of Package guam (Revision 8)
Currently displaying revision
8
,
Show latest
From f1df1fe2766912652a57c4c2cc1706e8eecf529f Mon Sep 17 00:00:00 2001 From: Aaron Seigo <aseigo@kde.org> Date: Tue, 28 Jun 2016 08:47:19 +0200 Subject: [PATCH] make add_starttls_to_capabilities work also on the first hello response .. which does not have a CAPABILITIES clause. do try to be put it after the the IMAP4v1 clause, though, for neatness --- apps/kolab_guam/src/kolab_guam_session.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/kolab_guam/src/kolab_guam_session.erl b/apps/kolab_guam/src/kolab_guam_session.erl index 9439018..1f3869b 100644 --- a/apps/kolab_guam/src/kolab_guam_session.erl +++ b/apps/kolab_guam/src/kolab_guam_session.erl @@ -296,7 +296,16 @@ ensure_hello_has_starttls(ServerResponse) -> add_starttls_to_capabilities(ServerHello) -> case binary:match(ServerHello, <<"CAPABILITY ">>) of - nomatch -> ServerHello; + nomatch -> add_starttls_after_imap4_atom(ServerHello); + { Start, End } -> + Prefix = binary:part(ServerHello, 0, Start + End), + Suffix = binary:part(ServerHello, Start + End, size(ServerHello) - Start - End), + <<Prefix/binary, "STARTTLS ", Suffix/binary>> + end. + +add_starttls_after_imap4_atom(ServerHello) -> + case binary:match(ServerHello, <<"IMAP4rev1 ">>) of + nomatch -> <<"STARTTLS ", ServerHello/binary>>; { Start, End } -> Prefix = binary:part(ServerHello, 0, Start + End), Suffix = binary:part(ServerHello, Start + End, size(ServerHello) - Start - End), -- 2.5.5
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.