Skip to content
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

Android Calendar don’t send invitation #190

Closed
Alexclarisse opened this issue Jan 31, 2014 · 18 comments
Closed

Android Calendar don’t send invitation #190

Alexclarisse opened this issue Jan 31, 2014 · 18 comments

Comments

@Alexclarisse
Copy link

I use Baikal with Thunderbird on my computer and Android for my Smartphone.

I have no problem of synchronization between my computer, my tablet and my smartphone.

My problem is that when I make an invitation in my schedule under Android, no invitation is sent to the guests.

I tried with the android e-mail and K9, as well as with the android calendar and the apps acalendar +.

For information it works well with Thunderbird with modules Lightening and Inverse SOGo Connector.

My mobile is a nexus 5 and my tablet nexus7 v1.
I use CalDAV-Sync for the calendar and CardDAV-Sync free for the contacts

I thought has a problem with Baikal or that you could give me a solution.

Please excuse me for my English.

I take advantage of this message to thank you for Baikal

See you soon

Alex

@sgalonska
Copy link

As far as I know, Baikal does not send any invitations at al. But since it is built on SabreDAV, adding automatic eMails is fairly easy. You can edit Core/Frameworks/Baikal/WWWRoot/cal.php and replace the following line

$server->addPlugin(new \Sabre\CalDAV\Plugin());

by

$caldavPlugin = new \Sabre\CalDAV\Plugin();
$caldavPlugin->setIMipHandler(new \Sabre\CalDAV\Schedule\IMip('sender@domain.com'));
$server->addPlugin($caldavPlugin);

There might be less intrusive ways to do it, but it worked for me.

@Alexclarisse
Copy link
Author

Thanks for your answer.
I tried but it does not work
Maybe CalDAV Sync doesn't support invitation.
Witch sync adapter do you use with your Android Mobile ?
Thanks

Alex

@sgalonska
Copy link

actually, if you do it as described, not CalDAV but the server itself will send the e-mail. Therefore it needs to be able to send mails. I forgot to mention, that it has to be either able to send mails from localhost and through PHP's mail() command or it needs the smtp server data to be configured propperly. For more info, check out https://code.google.com/p/sabredav/wiki/IMipHandler
You apparently need to subclass the \Sabre\CalDAV\Schedule\IMip class and configure your smtp parameters there.

@Alexclarisse
Copy link
Author

Hello,
Again, thank you for your answers

I followed your advice but I don’t know the Baikal solution and I'm not sure to understand the architecture and organization.

For information, I download the flat version seemed easier to start.
I uploaded all file on my server in the baikal-flat folder and I followed the installation and configure Mysql.

During your first response, you had told me to change in:

Core/Frameworks/Baikal/WWWRoot/cal.php

When I look at this, I can’t find it, I got only two sub folders:

  • domain.net/baikal-flat/Core/Frameworks/Baikal/Core
  • domain.net/baikal-flat/Core/Frameworks/Baikal/Model

I assumed that you gave the instructions to complete installation and for the flat file version change should be:

domain.net/baikal-flat/cal.php

Now I'm lost in tree. When I try to understand where the sub class ...

What cal.php file should I change and where there is

I also search for the class, I found:

Domain.net/baikal-flat/vendor/sabre/dav/lib/Sabre/CalDAV/Schedule/ IMip.php

Thank you in advance for your help and for the time you spend to me.

Later

Alex

@sgalonska
Copy link

Please make sure, you installed Baikal correctly. I used the current release (https://github.com/jeromeschneider/Baikal/releases/tag/0.2.6) so I can only speak to that. Unfortunately I did not find any flat file version, so sorry if I cannot speak to that either.

After downloading the code, you still have to install your vendor dependencies as described in the installation manual.

If your server is not capable to mail() itself because there it has no postfix installed on it, further steps will become necessary. Since my server is a mail server as well, I did not have to go any further. But I assume that subclassing the \Sabre\CalDAV\Schedule\IMip Class will do the trick. Please note, that this class is NOT in the baikal package but in the Vendor package of SabreDAV which you installed through composer.

Hope that helps!
-Sebastian

@muelli
Copy link

muelli commented Feb 7, 2014

hm. Interesting suggestion, to enable the IMip Handler. I think I did it, but I still don't know whether it works or not as I haven't received any email yet.
What is the test to check whether it works alright or not? I created a new calendar entry using the Android calendar and DAVDroid with an email address as "guest".

@Alexclarisse
Copy link
Author

Muelli
To test it, I use my android mobile, I create a new appointement in my calendar where I add an guest with my email adress. After just have to check my email if I got an notification.

Sgalonska
I just install regular package with SSH on my server.
I use the regular package on the official website of Baikal:
http://baikal-server.com/get/baikal-regular-0.2.7.tgz
Now I have to find how install Sabre in the Vendor folder.
If you know an url to help ...
Thanks

Later

@muelli
Copy link

muelli commented Feb 10, 2014

@Alexclarisse: what DAV implementation do you use on Android? I use DAVDroid and it seems as if there is no support for those messages: https://github.com/rfc2822/davdroid/issues/171

@Alexclarisse
Copy link
Author

@muelli: Thanks for the information, I also tried CalDAV-Sync
I'm looking for other solutions, I will let you know...
@sgalonska : What Dav connector do you use on your android device for calendar with Baikal ?
Later

@sgalonska
Copy link

Just a common hint, to maybe understand what Baikal is actually doing. The CalDAV and CardDAV server is actually handled by SabreDAV. Baikal's focus is on the administration of SabreDAV since it does not offer any of this by itself. If you choose the non-flat package the structure becomes more apparent since it forces you to install SabreDAV through composer. Please check how composer works in general to understand the manual installation process of SabreDAV. I always recommend to install composer globally, since it will most likely come in handy when working on your next PHP project. For further info on composer feel free to check https://github.com/composer/composer

@Alexclarisse
Copy link
Author

Hello,
For information, I use the PaaS offer in gandi.net
My Debian server have:

  • PHP Version 5.4.4-14+deb7u7.5
  • Apache/2.4.6.
  • Mysql 5.5.33

I also got roundcube webmail with the CardavPlugin.
Everythink is working to synch Webmail, Thunderbird/Lightening and Android devices, exept the notification for guest in android calendar when I'm going to create a new appointement.

I did what you told me:

I make a new install with the current release (https://github.com/jeromeschneider/Baikal/archive/0.2.7.tar.gz)
I also installed composer and use the composer.json to install vendor dependencies SabreDAV.

After I change the plugin line in

Core/Frameworks/Baikal/WWWRoot/cal.php to :

$caldavPlugin = new \Sabre\CalDAV\Plugin();
$caldavPlugin->setIMipHandler(new \Sabre\CalDAV\Schedule\IMip('my-email@domain.cc'));
$server->addPlugin($caldavPlugin);

I try different way but notification sender with IMIp are never send like:

# Support Mail
$caldavPlugin = new \Sabre\CalDAV\Plugin();
$caldavPlugin->setIMipHandler(
    new \Sabre\CalDAV\Schedule\IMip('my-email@domain.cc')
);

# Initializing server
$server = new \Sabre\DAV\Server($nodes);
$server->setBaseUri(BAIKAL_CAL_BASEURI);

# Server Plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, BAIKAL_AUTH_REALM));
$server->addPlugin(new \Sabre\DAVACL\Plugin());
$server->addPlugin(new \Sabre\CalDAV\Plugin());
$server->addPlugin($caldavPlugin);

# And off we go!
$server->exec();

I have only this problem with Android because Thunderbird send guest invitation.

I'm still looking for what I'm doing wrong...

@RustyPixel
Copy link

I was wondering if phpmailer implemented as a subclass to imip would it not give better than using mail() and have auth smtp instead.
https://github.com/PHPMailer/PHPMailer

@sgalonska
Copy link

It looks like you did everything right. Just check, if mail() really works on your machine

php -r "mail('youraddress@yourdomain.com', 'Testmail', 'this is a test');"

should send you an email. This is basically the same way, SabreDAV sends mails, too.

@Alexclarisse
Copy link
Author

I used your command in ssh and it's working well.
But I just learn that gandi use a sendmail command from an dedicaced SMTP server for all PaaS instancies when we use mail().
They also use Varnish (cache), I will try to add

header("Cache-Control: max-age=1"); // don't cache the php plugin

For all my test I put my personnal email and I read we can't use the same email adress so I will try with another one...
Thanks again for your time and your help.
I will let you know, later

@uvok
Copy link

uvok commented Apr 15, 2014

I have the same problem
As far as I can see, the method for actually sending the invitation never gets called at all.
It's in ./vendor/sabre/dav/lib/Sabre/CalDAV/Plugin.php
Function "unknown method" never gets called.
Line 181 public function unknownMethod($method, $uri), case POST which would do $this->outboxRequest($node, $uri); (line 202), which contains

   730          } elseif ($componentType === 'VEVENT' && in_array($method, array('REQUEST','REPLY','ADD','CANCEL'))) {

   731              $acl && $acl->checkPrivileges($outboxUri,'{' . Plugin::NS_CALDAV . '}schedule-post-vevent');
   732              $this->handleEventNotification($outboxNode, $vObject);

handleEventNotification would somewhere around line 790 call iMIPMessage().

So actually, this is a SabreDAV issue?

(found out via calling non.existing functions at the beginning of each functions, then creating an event with invited guests in Android calender (sync happening via DavDroid)) in the hope of an error being written to the PHP error log).

@osos
Copy link

osos commented Aug 21, 2014

Owncloud seems to also have this problem.

owncloud/calendar#318

@evert
Copy link
Member

evert commented Aug 23, 2014

Sending invitations by email using the imip handler is a feature that only exists as a workaround for an iCal bug, and only iCal can ever trigger sending of invitation emails.

In the upcoming sabredav 2.1 release we added full scheduling support, which will work for every client.

@netgusto
Copy link
Member

Continued in #304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants