Fix so additional headers are added to all messages sent (#1489284)

Conflicts:

	plugins/additional_message_headers/additional_message_headers.php
	program/lib/Roundcube/rcube.php
pull/117/head
Aleksander Machniak 11 years ago
parent eae2a1e684
commit 70eac89a5c

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fix so additional headers are added to all messages sent (#1489284)
- Fix display issue after moving folder in Folder Manager (#1489293) - Fix display issue after moving folder in Folder Manager (#1489293)
- Fix handling of non-default date formats (#1489294) - Fix handling of non-default date formats (#1489294)
- Fix unquoted path in PREG expression on Windows (#1489290) - Fix unquoted path in PREG expression on Windows (#1489290)

@ -15,29 +15,32 @@
*/ */
class additional_message_headers extends rcube_plugin class additional_message_headers extends rcube_plugin
{ {
public $task = 'mail';
function init() function init()
{ {
$this->add_hook('message_outgoing_headers', array($this, 'message_headers')); $this->add_hook('message_before_send', array($this, 'message_headers'));
} }
function message_headers($args) function message_headers($args)
{ {
$this->load_config(); $this->load_config();
$headers = $args['message']->headers();
$rcube = rcube::get_instance();
// additional email headers // additional email headers
$additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array()); $additional_headers = $rcube->config->get('additional_message_headers', array());
foreach($additional_headers as $header=>$value){ foreach ((array)$additional_headers as $header => $value) {
if (null === $value) { if (null === $value) {
unset($args['headers'][$header]); unset($headers[$header]);
} else { }
$args['headers'][$header] = $value; else {
$headers[$header] = $value;
} }
} }
$args['message']->_headers = array();
$args['message']->headers($headers);
return $args; return $args;
} }
} }
?>

@ -13,11 +13,10 @@
<email>email@example.org</email> <email>email@example.org</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2010-01-16</date> <date>2013-08-25</date>
<time>18:19:33</time>
<version> <version>
<release>1.1.0</release> <release>1.2.0</release>
<api>1.1.0</api> <api>1.2.0</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>stable</release>

@ -958,6 +958,10 @@ class rcmail extends rcube
'options' => $options, 'options' => $options,
)); ));
if ($plugin['abort']) {
return isset($plugin['result']) ? $plugin['result'] : false;
}
$from = $plugin['from']; $from = $plugin['from'];
$mailto = $plugin['mailto']; $mailto = $plugin['mailto'];
$options = $plugin['options']; $options = $plugin['options'];

@ -1295,6 +1295,7 @@ class rcube
return $_SESSION['language']; return $_SESSION['language'];
} }
} }
} }

@ -462,6 +462,7 @@ if (!empty($CONFIG['useragent'])) {
} }
// exec hook for header checking and manipulation // exec hook for header checking and manipulation
// Depracated: use message_before_send hook instead
$data = $RCMAIL->plugins->exec_hook('message_outgoing_headers', array('headers' => $headers)); $data = $RCMAIL->plugins->exec_hook('message_outgoing_headers', array('headers' => $headers));
// sending aborted by plugin // sending aborted by plugin

Loading…
Cancel
Save