Make itip links optional and disabled by default
This feature has ever had many limitations and inconsistent behaviour depending if the user is logged in or not. Also in meantime, PHP's mail() support has been removed from Roundcube Framework. Now to enable the feature you have to set calendar_itip_smtp_server option.
This commit is contained in:
parent
211fe3ada5
commit
bb3b7fec0e
2 changed files with 6 additions and 17 deletions
|
@ -138,8 +138,9 @@ $config['calendar_freebusy_trigger'] = false;
|
||||||
$config['calendar_include_freebusy_data'] = 1;
|
$config['calendar_include_freebusy_data'] = 1;
|
||||||
|
|
||||||
// SMTP server host used to send (anonymous) itip messages.
|
// SMTP server host used to send (anonymous) itip messages.
|
||||||
// Set to '' in order to use PHP's mail() function for email delivery.
|
|
||||||
// To override the SMTP port or connection method, provide a full URL like 'tls://somehost:587'
|
// To override the SMTP port or connection method, provide a full URL like 'tls://somehost:587'
|
||||||
|
// This will add a link to invitation messages to allow users from outside
|
||||||
|
// to reply when their mail clients do not support iTip format.
|
||||||
$config['calendar_itip_smtp_server'] = null;
|
$config['calendar_itip_smtp_server'] = null;
|
||||||
|
|
||||||
// SMTP username used to send (anonymous) itip messages
|
// SMTP username used to send (anonymous) itip messages
|
||||||
|
|
|
@ -44,7 +44,6 @@ class libcalendaring_itip
|
||||||
array('identity' => $this->rc->user->list_emails(true)));
|
array('identity' => $this->rc->user->list_emails(true)));
|
||||||
$this->sender = $hook['identity'];
|
$this->sender = $hook['identity'];
|
||||||
|
|
||||||
$this->plugin->add_hook('message_before_send', array($this, 'before_send_hook'));
|
|
||||||
$this->plugin->add_hook('smtp_connect', array($this, 'smtp_connect_hook'));
|
$this->plugin->add_hook('smtp_connect', array($this, 'smtp_connect_hook'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +151,10 @@ class libcalendaring_itip
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// append links for direct invitation replies
|
// append links for direct invitation replies
|
||||||
if ($method == 'REQUEST' && $rsvp && ($token = $this->store_invitation($event, $recipient['email']))) {
|
if ($method == 'REQUEST' && $rsvp
|
||||||
|
&& $this->rc->config->get('calendar_itip_smtp_server')
|
||||||
|
&& ($token = $this->store_invitation($event, $recipient['email']))
|
||||||
|
) {
|
||||||
$mailbody .= "\n\n" . $this->gettext(array(
|
$mailbody .= "\n\n" . $this->gettext(array(
|
||||||
'name' => 'invitationattendlinks',
|
'name' => 'invitationattendlinks',
|
||||||
'vars' => array('url' => $this->plugin->get_url(array('action' => 'attend', 't' => $token))),
|
'vars' => array('url' => $this->plugin->get_url(array('action' => 'attend', 't' => $token))),
|
||||||
|
@ -177,20 +179,6 @@ class libcalendaring_itip
|
||||||
return $sent;
|
return $sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Plugin hook triggered by rcube::deliver_message() before delivering a message.
|
|
||||||
* Here we can set the 'smtp_server' config option to '' in order to use
|
|
||||||
* PHP's mail() function for unauthenticated email sending.
|
|
||||||
*/
|
|
||||||
public function before_send_hook($p)
|
|
||||||
{
|
|
||||||
if ($this->itip_send && !$this->rc->user->ID && $this->rc->config->get('calendar_itip_smtp_server', null) === '') {
|
|
||||||
$this->rc->config->set('smtp_server', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin hook to alter SMTP authentication.
|
* Plugin hook to alter SMTP authentication.
|
||||||
* This is used if iTip messages are to be sent from an unauthenticated session
|
* This is used if iTip messages are to be sent from an unauthenticated session
|
||||||
|
|
Loading…
Add table
Reference in a new issue