I hit this five years ago when first enabling calendar support. I don’t delete email and have surgemail-list going back to 2007! I found the five year old conversation with Marijn about this same problem when first enabling calendar sync.
I require all users to use SSL (i.e. g_ssl_require_login = *). Here’s the fix:
Editing surgemail/phplib/netwin/NWAuth_sabre.php should do the trick to force sabredav to use ssl:
$imap = imap_open("{127.0.0.1:993/ssl}INBOX", $username, $password, OP_HALFOPEN);
And if the certs do not match the url (which they probably won't even for valid signed certificates due to using the localhost ip address) you can use the following:
$imap = imap_open("{127.0.0.1:993/ssl/novalidate-cert}INBOX", $username, $password, OP_HALFOPEN);
I do need the novalidate-cert option, so I used the second version above and calendar sync is working again.
Unfortunately, I must remember to make this change every time I update SurgeMail. I should create a patchfile...
--
John Wilkes
john@wilkes.com
One of the advantages of being disorderly is that
I am constantly making interesting discoveries.
> On Mar 14, 2018, at 9:18 PM, John Wilkes <john@wilkes.com> wrote:
>
> More error information:
>
> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
> <s:exception>Sabre_DAV_Exception_NotAuthenticated</s:exception>
> <s:message>No basic authentication headers were found</s:message>
> <s:sabredav-version>1.6.2</s:sabredav-version>
> </d:error>
>
> --
> John Wilkes
> john@wilkes.com
>
> One of the advantages of being disorderly is that
> I am constantly making interesting discoveries.
>
>
>
>
>
>> On Mar 13, 2018, at 11:00 PM, John Wilkes <john@wilkes.com> wrote:
>>
>> I am having trouble getting calendar sync working; I can’t authenticate.
>>
>> I had calendar sync working previously on an old OpenSuSE system, but that hardware died. I tried Ubuntu 16.04 Server, but I could not get calendar sync working there. If I recall correctly, the version of the available php package was not compatible (too new), and I did not want to build it from source. I recently moved my SurgeMail server to Centos 7, and I am seeing the same problem. My understanding is that calendar sync is known to work with php 5.3 and php 5.6.
>>
>> SurgeMail Version 7.3c3-3, Built Jun 7 2017
>>
>> I’ve installed the various pieces. The netwin script reports:
>> PHP version = 5.4.16
>> IMAP module = INSTALLED
>> PDO database module = INSTALLED
>> PDO_SQLITE database module = INSTALLED
>> MBSTRING module = INSTALLED
>> XML (DOM) module = INSTALLED
>> When I try to login at https//myserver.mydomain/cal my username/password is not accepted. I know it is correct.
>>
>> If I login to SurgeWeb and click “Calendar” a box appears at the top:
>>
>> Cal Request Failed: 401 Unauthorized
>>
>> I can telnet to 127.0.0.1:143
>>
>> # telnet 127.0.0.1 143
>> Trying 127.0.0.1...
>> Connected to 127.0.0.1.
>> Escape character is '^]'.
>> * OK IMAP (C) myserver.mydomain (Version 7.3c3-3)
>>
>> I have tried both $type=1 and $type=2 in Nwauth_sabre.php
>>
>> --
>> John Wilkes
>> john@wilkes.com
>>
>> One of the advantages of being disorderly is that
>> I am constantly making interesting discoveries.
>>
>>
>>
>
>
|