4 * Additional Message Headers
6 * Very simple plugin which will read additional headers for outgoing messages from the config file.
8 * Enable the plugin in config/main.inc.php and add your desired headers.
12 * @website http://roundcube.net
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'] . ')';
23 class additional_message_headers extends rcube_plugin
25 public $task = 'mail';
29 $this->add_hook('outgoing_message_headers', array($this, 'message_headers'));
32 function message_headers($args){
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;