You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

additional_message_headers.php 929B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Additional Message Headers
  4. *
  5. * Very simple plugin which will add additional headers
  6. * to or remove them from outgoing messages.
  7. *
  8. * Enable the plugin in config.inc.php and add your desired headers:
  9. * $config['additional_message_headers'] = array('User-Agent' => 'My-Very-Own-Webmail');
  10. *
  11. * @author Ziba Scott
  12. * @website http://roundcube.net
  13. */
  14. class additional_message_headers extends rcube_plugin
  15. {
  16. function init()
  17. {
  18. $this->add_hook('message_before_send', array($this, 'message_headers'));
  19. }
  20. function message_headers($args)
  21. {
  22. $this->load_config();
  23. $rcube = rcube::get_instance();
  24. // additional email headers
  25. $additional_headers = $rcube->config->get('additional_message_headers', array());
  26. if (!empty($additional_headers)) {
  27. $args['message']->headers($additional_headers, true);
  28. }
  29. return $args;
  30. }
  31. }