source: github/plugins/additional_message_headers/additional_message_headers.php @ cc97ea0

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since cc97ea0 was cc97ea0, checked in by thomascube <thomas@…>, 4 years ago

Merged branch devel-api (from r2208 to r2387) back into trunk (omitting some sample plugins)

  • Property mode set to 100644
File size: 1.3 KB
Line 
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 */
23class 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}
Note: See TracBrowser for help on using the repository browser.