Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Comandline download of Calendar with wget
  •  
kgauler

Messages: 1
Karma: 0
Send a private message to this user
Hi,

I try to download calendars by the windows commandline tool wget. Does anybody got it already running?

Trying:
wget http://myname:password<_at_>192.168.0.72/ical/my-domain/myname/Calendar

I get the following message:
Connecting to 192.168.0.72:80... connected.
HTTP request sent, awaiting response... 200 ok
Length: 0 [text/calendar]
Saving to: xxxxxx and so on.

There is a file saved, but it is empty. Using the same http-link manually in a browser, I get the window to save the save and all is ok. Anonymous has reading access.

What is going wrong here?

thanks for your help.

Klaus Gauler

  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
As you may notice the Length: tag yields 0. This is due to the HTTP header field content of Content-length which is zero too. If you call your wget as follows:

wget h++p://myname:password<_at_>192.168.0.72/ical/my-domain/myname/Calendar --ignore-length

(++ should be tt but I cannot post links yet...)

wget will just read until it receives no bytes anymore.

Question to Kerio:

when I use wget with the --ignore-length flag or browser to download the calendar all goes well. When I use wget without the flag of with google calendar the authentication succeeds but I get no data returned. Is this kerios settings that is causing this problem i.e. does kerio send Content-Length: 0 in the header? If so please calculate this value to support other methods of access more easy.
  •  
Pavel Dobry (Kerio)

Messages: 5245
Karma: 251
Send a private message to this user
We don't use Content-length:0 header - it does not make a sense BTW.
Please try to use 'wget -S' parameter to get the response headers. Wget works fine even without --ignore-length parameter, which does not make a sense on this case at all.
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
I know, it really doesn't make sense to misinform. Actually according to the RFC's a client should alert the user when the data length does not match the content-length field value.
Anyway here's the output of wget -S

$: wget ht++ps://[server]/ical/[mailserver]/[user]/Calendar -S
--2011-01-19 08:07:47-- ht++ps://[server]/ical/[mailserver]/[user]/Calendar
Resolving proxy.xxx.xx... 10.10.1.4
Connecting to proxy.xxx.xx|10.10.1.4|:[port]... connected.
Proxy request sent, awaiting response...
HTTP/1.1 200 OK
Connection: Close
Content-Disposition: attachment;filename="Calendar of user '[user]@[mailserver]' - ~[user]<_at_>[mailserver]/Calendar.ics"
Content-Length: 0
Content-Type: text/calendar
Date: Wed, 19 Jan 2011 07:07:58 GMT
Transfer-Encoding: chunked
X-UA-Compatible: IE=8
Length: 0 [text/calendar]
Saving to: `Calendar'

[ <=> ] 0 --.-K/s in 0s

2011-01-19 08:07:47 (0.00 B/s) - `Calendar' saved [0/0]

As you can see the content-length field value _is_ actually zero, justifying the --ingore-length option. The output of wget -S was the reason for me to try it in the first place...

So, the question now is were this field comes from? It isn't created by wget, that's for sure...

typo[/edit]

[Updated on: Wed, 19 January 2011 08:21]

  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
I tried to download the agenda from different locations now (my webserver, at work, at th client's, at home) and everywhere in get the Content-Length: 0 back. I'b bet this is causing the problems with importing the agenda into google calendar as well.

Could you provide some feedback as were to look for to solve this problem? Clearly I'm not the only one having this issue. Maybe it has something to do with certain settings?

I'll try to program a gateway to filter the Content-Length from the headers as to confirm that the problem related to google calendar does indeed lie there.

Thanks!
  •  
Pavel Dobry (Kerio)

Messages: 5245
Karma: 251
Send a private message to this user
You're right. It seems to happen only when the resulting .ics file has size lower than 4kB. Workaround is simple. Just create an event in the calendar and put 4kB of text into the event notes. Everything starts working fine then.
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
Indeed that works! wget now receives the whole ICS file. Still no data in Google calendar though. Are there any known issues using kerio connect over https and google? (I can imagine something going wrong with certificates?)
  •  
marook

Messages: 520

Karma: 3
Send a private message to this user
Why do you use anonymous to get data to Google?
Google can fetch the data fine directly with authorization!

Regards,

Jakob Peterhänsel
Consultant - Humac A/S

Apple Certified Support Professional (ACSP)
Apple Certified Technical Coordinator (ACTC)
AppleSeed/CQF member since 1998
Kerio Messaging Partner
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
Even better! Then I can actually sync with Google Smile Could you tell me how I would do it? I've been searching, but to no avail so far..

[Updated on: Mon, 24 January 2011 20:19]

  •  
marook

Messages: 520

Karma: 3
Send a private message to this user
Ctr-click the calendar: Use in calendar client...
Copy the 'manual' link (https://mail.domain.com/ical/domain.com/user/calName)

Over in Google:
Add: via weblink (under the calendar list)
Paste the link from above...

After some testing, it seems to be a bit broken - at least here.
1: Authorization is not supported by Google
2: I'm not shure HTTPS is...
3: It loads my Cal, after adding a Anonumous Reader access, but then fails before completing...

It used to work, so where the issue is, I'm not sure... :-/

Regards,

Jakob Peterhänsel
Consultant - Humac A/S

Apple Certified Support Professional (ACSP)
Apple Certified Technical Coordinator (ACTC)
AppleSeed/CQF member since 1998
Kerio Messaging Partner
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
Alas, it is as I expected. Much how I'd like it to work, indeed it seems that https gives problems in Google Calendar... Also the authentication is not an option, though I understand from you that it has worked in the past. Pity...

Now if only I could add the iCal file to google calender using wget or some other commandline tool. Then I could just start a cron job on my server every 5 minutes or so and make it work like that Razz.

You wouldn't happen to know the wget command line for adding a iCal to a certain google calendar, would you? Basically something like in the picture but then not using a browser!

(p.s. the image is in Dutch (since I am Dutch) but I think you all recognize the dialog Wink)

  •  
marook

Messages: 520

Karma: 3
Send a private message to this user
I think the best way would be to use support.kerio.com and ask what the best optin is. It should work, but currently don't.

Have you tried using annonumous access to you calendar?
Maybe make a new calendar 'folder' and try with that first.. it seems to work here, but then fails - maybe because I have some events Google can't parse/handle???

Regards,

Jakob Peterhänsel
Consultant - Humac A/S

Apple Certified Support Professional (ACSP)
Apple Certified Technical Coordinator (ACTC)
AppleSeed/CQF member since 1998
Kerio Messaging Partner
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
Yeah I have the anonymous access enabled. Also I tested with 1 event and just the 4kb of text as well as generating a ics > 4kb with regular events. Both won't work. I don't get any errors back from google, but the calendar stays empty.

Last night I tried downloading the calendar ics using file_get_contents in PHP, which actually does download my agenda. Maybe tomorrow I'll implement proper headers and use that hyperlink to download my calendar in google.

I'll post the code if it works!
  •  
nebula

Messages: 8
Karma: 0
Send a private message to this user
Alright! It works! I have the kerio agenda in Google Calendar now Smile

Here's the PHP code to do it:

<?php
$ics = file_get_contents("<URL to the calendar>");

header("Content-Disposition: attachment;filename=\"Calendar - ~calendar.ics\"");
header("Content-Type: text/calendar");
header("Transfer-Encoding: chunked");
header("X-UA-Compatible: IE=8");

echo $ics;

?>



Pretty straightforward but it works!
Previous Topic: New User
Next Topic: Hack attempt or what ?
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Sun Nov 19 11:23:08 CET 2017

Total time taken to generate the page: 0.00573 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.