I'm trying to access my Fastmail calendar through Python. I'm using the caldav
module as suggested by this answer. This is what my code looks like:
def main():
auth = HTTPBasicAuth(username='mail@domain.com', password='myapplicationpassword')
client = caldav.DAVClient('https://caldav.fastmail.com', auth=auth)
try:
client.principal()
except Exception as e:
print(e)
And client.principal()
raises an exception:
404 Not Found
b'<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor="white">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
I also tried with client = caldav.DAVClient('https://caldav.fastmail.com', username='mail@domain.com', password='myapplicationpassword')
and achieved the same result.
Finally, I took a look at the caldav example using iCloud, and tried to reproduce the same idea with fastmail. I ran into the very same issue (principal_response
has a 404 status code).
What am I missing?