]> git.donarmstrong.com Git - roundcube.git/blob - plugins/additional_message_headers/additional_message_headers.php
Imported Upstream version 0.3
[roundcube.git] / plugins / additional_message_headers / additional_message_headers.php
1 <?php
2
3 /**
4  * Additional Message Headers
5  *
6  * Very simple plugin which will read additional headers for outgoing messages from the config file.
7  *
8  * Enable the plugin in config/main.inc.php and add your desired headers.
9  *
10  * @version 1.0
11  * @author Ziba Scott
12  * @website http://roundcube.net
13  * 
14  * Example:
15  *
16  * $rcmail_config['additional_message_headers']['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT'];
17  * $rcmail_config['additional_message_headers']['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
18  * $rcmail_config['additional_message_headers']['X-RoundCube-Server'] = $_SERVER['SERVER_ADDR'];
19  * if( isset( $_SERVER['MACHINE_NAME'] )) {
20  *     $rcmail_config['additional_message_headers']['X-RoundCube-Server'] .= ' (' . $_SERVER['MACHINE_NAME'] . ')';
21  * }
22  */
23 class additional_message_headers extends rcube_plugin
24 {
25     public $task = 'mail';
26     
27     function init()
28     {
29         $this->add_hook('outgoing_message_headers', array($this, 'message_headers'));
30     }
31
32     function message_headers($args){
33
34         // additional email headers
35         $additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array());
36         foreach($additional_headers as $header=>$value){
37             $args['headers'][$header] = $value;
38         }
39
40         return $args;
41     }
42 }