Received-SPF: pass (Last token {mx} (res=PASS)) client-ip=46.226.110.80; envelope-from=<john@wilkes.com>; x-ip-name=mx.wilkes.com;
X-Received: from wilkes.com (mx.wilkes.com [46.226.110.80])
by netwin.co.nz (SurgeMail 7.3h) with ESMTP id 472003-1391920
for <surgemail-list@netwin.co.nz>; Thu, 15 Mar 2018 05:12:10 +0000
X-Return-Path: john
X-Default-Received-SPF: pass (skip=forwardok (res=PASS));
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: [SurgeMail List] calendar sync: authorization fails (problem solved!)
From: John Wilkes
In-Reply-To: <5C5E3F78-0AE0-4705-936E-4B94B52992F8@wilkes.com>
Date: Wed, 14 Mar 2018 22:12:02 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <D0F8E885-382A-4A2C-96CA-25EB8F93E2BD@wilkes.com>
References: <17F42842-D137-4489-9FAD-69971C30FBC6@wilkes.com> <5C5E3F78-0AE0-4705-936E-4B94B52992F8@wilkes.com>
To: surgemail-list@netwin.co.nz
X-Mailer: Apple Mail (2.3124)
X-X-Authenticated-User: john@wilkes.com
X-Originating-IP: 46.226.110.80
X-Country: code=FR country="France" ip=46.226.110.80
X-Rcpt-To: <surgemail-list@netwin.co.nz>
X-SpamDetect: ******: 6.6 sd=6.6 NoRule 0.04(X-myrbl:Color=white) 0.94(X-Country:france) 0.90(X-Phrase:isspam) 0.76(X-Verify-Helo:-ERR) 0.28(X-Verify-Helo:wrongip) 0.71(X-PhraseHits:scam) 0.44(X-LangGuess:English) 0.52(spfpass) 0.48(X-NotAscii:utf) Saned 5.0 sanityx 6.6 Moved 5.0->6.6 Sval 6.6
X-NotAscii: charset=utf-8
X-LangGuess: English
X-Probe: +OK skipped, known ip address
X-Phrase: IsSpam score=1.00
X-Verify-Helo: -ERR wrongip: wilkes.com -> 204.238.*.* not in 46.226.110.80
X-MyRbl: Color=White Age=17 Spam=0 Notspam=0 Stars=0 Good=7 Friend=12 Surbl=0 Catch=0 r=0 ip=46.226.110.80
X-IP-stats: Incoming Outgoing Last 0, First 5, in=346, out=12, spam=0 Known=true ip=46.226.110.80
List-Unsubscribe: <mailto:surgemail-list-leave@netwin.co.nz?subject=unsubscribe>
X-Mailing-List: surgemail-list@netwin.co.nz
List-ID: <surgemail-list@netwin.co.nz>
Precedence: bulk
Reply-To: surgemail-list@netwin.co.nz
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.
>>
>>
>>
>
>
|