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 959B

1234567891011121314151617181920212223242526272829303132333435363738
  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. * @version @package_version@
  12. * @author Ziba Scott
  13. * @website http://roundcube.net
  14. */
  15. class additional_message_headers extends rcube_plugin
  16. {
  17. function init()
  18. {
  19. $this->add_hook('message_before_send', array($this, 'message_headers'));
  20. }
  21. function message_headers($args)
  22. {
  23. $this->load_config();
  24. $rcube = rcube::get_instance();
  25. // additional email headers
  26. $additional_headers = $rcube->config->get('additional_message_headers', array());
  27. if (!empty($additional_headers)) {
  28. $args['message']->headers($additional_headers, true);
  29. }
  30. return $args;
  31. }
  32. }