Mercurial > hg > rc1
comparison plugins/additional_message_headers/additional_message_headers.php @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:50:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e000243b222 |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * Additional Message Headers | |
5 * | |
6 * Very simple plugin which will add additional headers | |
7 * to or remove them from outgoing messages. | |
8 * | |
9 * Enable the plugin in config.inc.php and add your desired headers: | |
10 * $config['additional_message_headers'] = array('User-Agent' => 'My-Very-Own-Webmail'); | |
11 * | |
12 * @author Ziba Scott | |
13 * @website http://roundcube.net | |
14 */ | |
15 class additional_message_headers extends rcube_plugin | |
16 { | |
17 function init() | |
18 { | |
19 $this->add_hook('message_before_send', array($this, 'message_headers')); | |
20 } | |
21 | |
22 function message_headers($args) | |
23 { | |
24 $this->load_config(); | |
25 | |
26 $rcube = rcube::get_instance(); | |
27 | |
28 // additional email headers | |
29 $additional_headers = $rcube->config->get('additional_message_headers', array()); | |
30 | |
31 if (!empty($additional_headers)) { | |
32 $args['message']->headers($additional_headers, true); | |
33 } | |
34 | |
35 return $args; | |
36 } | |
37 } |