Ignore:
Timestamp:
Nov 19, 2009 2:42:27 PM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
bc6ac4d
Parents:
b1d3a4e1
Message:
  • additional_message_headers: allow unsetting headers, support plugin's config file (#1486268)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/additional_message_headers/additional_message_headers.php

    rcc97ea0 r469f84f  
    44 * Additional Message Headers 
    55 * 
    6  * Very simple plugin which will read additional headers for outgoing messages from the config file. 
     6 * Very simple plugin which will add additional headers to or remove them from outgoing messages. 
    77 * 
    8  * Enable the plugin in config/main.inc.php and add your desired headers. 
    9  * 
    10  * @version 1.0 
     8 * @version 1.1 
    119 * @author Ziba Scott 
    1210 * @website http://roundcube.net 
    13  *  
    14  * Example: 
    1511 * 
    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  * } 
     12 * See config.inc.php.disc  
    2213 */ 
    2314class additional_message_headers extends rcube_plugin 
     
    3021    } 
    3122 
    32     function message_headers($args){ 
     23    function message_headers($args) 
     24    { 
     25        $this->load_config(); 
    3326 
    3427        // additional email headers 
    3528        $additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array()); 
    3629        foreach($additional_headers as $header=>$value){ 
    37             $args['headers'][$header] = $value; 
     30            if (null === $value) { 
     31                unset($args['headers'][$header]); 
     32            } else { 
     33                $args['headers'][$header] = $value; 
     34            } 
    3835        } 
    3936 
     
    4138    } 
    4239} 
     40 
     41?> 
Note: See TracChangeset for help on using the changeset viewer.