commit | author | age
|
48e9c1
|
1 |
<?php |
T |
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 |
* |
461a30
|
9 |
* Enable the plugin in config.inc.php and add your desired headers: |
48e9c1
|
10 |
* $rcmail_config['additional_message_headers'] = array('User-Agent'); |
T |
11 |
* |
|
12 |
* @version @package_version@ |
|
13 |
* @author Ziba Scott |
|
14 |
* @website http://roundcube.net |
|
15 |
*/ |
|
16 |
class additional_message_headers extends rcube_plugin |
|
17 |
{ |
|
18 |
public $task = 'mail'; |
|
19 |
|
|
20 |
function init() |
|
21 |
{ |
|
22 |
$this->add_hook('message_outgoing_headers', array($this, 'message_headers')); |
|
23 |
} |
|
24 |
|
|
25 |
function message_headers($args) |
|
26 |
{ |
461a30
|
27 |
$this->load_config(); |
48e9c1
|
28 |
|
T |
29 |
// additional email headers |
|
30 |
$additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array()); |
|
31 |
foreach($additional_headers as $header=>$value){ |
|
32 |
if (null === $value) { |
|
33 |
unset($args['headers'][$header]); |
|
34 |
} else { |
|
35 |
$args['headers'][$header] = $value; |
|
36 |
} |
|
37 |
} |
|
38 |
|
|
39 |
return $args; |
|
40 |
} |
|
41 |
} |