source: github/plugins/additional_message_headers/additional_message_headers.php @ 469f84f

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since 469f84f was 469f84f, checked in by alecpl <alec@…>, 3 years ago
  • additional_message_headers: allow unsetting headers, support plugin's config file (#1486268)
  • Property mode set to 100644
File size: 939 bytes
Line 
1<?php
2
3/**
4 * Additional Message Headers
5 *
6 * Very simple plugin which will add additional headers to or remove them from outgoing messages.
7 *
8 * @version 1.1
9 * @author Ziba Scott
10 * @website http://roundcube.net
11 *
12 * See config.inc.php.disc
13 */
14class additional_message_headers extends rcube_plugin
15{
16    public $task = 'mail';
17   
18    function init()
19    {
20        $this->add_hook('outgoing_message_headers', array($this, 'message_headers'));
21    }
22
23    function message_headers($args)
24    {
25        $this->load_config();
26
27        // additional email headers
28        $additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array());
29        foreach($additional_headers as $header=>$value){
30            if (null === $value) {
31                unset($args['headers'][$header]);
32            } else {
33                $args['headers'][$header] = $value;
34            }
35        }
36
37        return $args;
38    }
39}
40
41?>
Note: See TracBrowser for help on using the repository browser.