-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DavMail connection not working with python-caldav, requires patched version of 0.7.0 #189
Comments
Interesting, I've never heard of DAVMail before. It would be very useful to have some kind of test account that I could use for reproducing the error and/or run the test suite against, do you have any possibility to help me with that? Or would it be better to reach out to the DAVMail community? |
I've sent an email to @mguessan Alternatively, you would have to dig more into it yourself. Obviously |
Thanks for your quick response! I don't think I can provide you with a test account. We use DAVMail to provide a CalDAV interface to MS Exchange. Maybe another relevant bit of info: the [email protected] is an Outlook shared mailbox. Here's the response for the calendar-home-set PROPFIND request when connecting to
Removing the workaround for OwnCloud (see 0e224be) seems to work for this case. Then, the calendar-home-set is set by Lines 419 to 420 in 529073d
When connecting to
So the href is different and the calendar-home-set is found. But even then, I don't get any calendar unless I:
The responses are identical in both cases, the both contain
but of course So personal and shared mailboxes have slightly different issues. Both work fine if Lines 445 to 446 in 99494d1
|
Do you connect as the user
I guess that is a calendar URL. I'm not sure if it's very well defined what the calendar-home-set should be for a calendar - the parent directory of the calendar, the calendar home set for the currently logged-in-user or undef. This is the first time I see the latter, but that does not necessarily mean it's a breach of standards.
200 OK, but an empty prop response. Perhaps 404 would have been more appropriate.
Except for the risk of a None-value causing problems further on ... it seems like a no-brainer to include that, I've cherry-picked it into my master branch. Perhaps the "correct" would be to continue probing and searching for a valid calendar-home-set if none is found. At the other hand, there may be situations where the calendar-home-set is not needed. And I wouldn't add any complexity without having evidence that it will solve real-world problems.
No, I don't think so. The at-sign in an URL should be used only for URLs containing username and password, and should only be used in the beginning of the URL to separate those two. |
In both cases, I connect at [email protected]. If you want me to test any further updates against our davmail instance, I'll gladly do so. Thanks for your work! |
I have a commit coming up now that I'd like you to test ... |
With this fix, I still get zero calendars, both for In objects.py:105, For the personal calendar, this is because the calendar_home_set is returned by the server as Maybe it's enough to check if the url already contains "calendar" at the end? With this change, everything works for me: diff --git a/caldav/objects.py b/caldav/objects.py
index a051f79..016e1f1 100644
--- a/caldav/objects.py
+++ b/caldav/objects.py
@@ -117,8 +117,9 @@ class DAVObject(object):
# And why is the strip_trailing_slash-method needed?
# The collection URL should always end with a slash according
# to RFC 2518, section 5.2.
- if (self.url.canonical().strip_trailing_slash() !=
- self.url.join(path).canonical().strip_trailing_slash()):
+ if (self.url.canonical().strip_trailing_slash().endswith("calendar")
+ or (self.url.canonical().strip_trailing_slash() !=
+ self.url.join(path).canonical().strip_trailing_slash())):
c.append((self.url.join(path), resource_types,
resource_name))
Edit: The comment in the code block says |
Hmmm ... what you are saying is that the calendar-home-set URL and the calendar URL is the same? You may be right that it may make sense to check the This is the |
Yes, for both private and shared mailboxes. Afaics, .children() is only used very few times, so the following check should be safe: diff --git a/caldav/objects.py b/caldav/objects.py
index a051f79..75cb86c 100644
--- a/caldav/objects.py
+++ b/caldav/objects.py
@@ -117,8 +117,9 @@ class DAVObject(object):
# And why is the strip_trailing_slash-method needed?
# The collection URL should always end with a slash according
# to RFC 2518, section 5.2.
- if (self.url.canonical().strip_trailing_slash() !=
- self.url.join(path).canonical().strip_trailing_slash()):
+ if ((isinstance(self, CalendarSet) and type == cdav.Calendar.tag)
+ or (self.url.canonical().strip_trailing_slash() !=
+ self.url.join(path).canonical().strip_trailing_slash())):
c.append((self.url.join(path), resource_types,
resource_name))
|
That seems good. Can you prepare it as a commit or a pull request? |
Thanks for the quick response :) |
Hi, I'm connecting to a DavMail 6.0.1-3009 client. I'm attempting to connect to a caldav url like so:
With python-caldav 0.9.0, I get the following error:
This seems to be the same error as #172, however unlike with icloud, it also doesn't work to connect to https://caldav.example.org/ directly.
With python-caldav 0.7.0, I can connect (and read everything just fine), but only after removing the check here:
https://github.com/python-caldav/caldav/blob/master/caldav/objects.py#L120
Otherwise, zero calendars are detected.
The text was updated successfully, but these errors were encountered: