Remove imp/config/header.php config file
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 22:55:22 +0000 (16:55 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 23:38:00 +0000 (17:38 -0600)
imp/config/conf.xml
imp/config/header.php.dist [deleted file]
imp/config/hooks.php.dist
imp/docs/UPGRADING
imp/lib/Compose.php

index 0d342c2..99165a5 100644 (file)
 
  <configtab name="compose" desc="Compose">
   <configsection name="msg">
-   <configboolean name="prepend_header" desc="Should we include the contents of
-   imp/config/header.php in the headers of every message
-   sent?">true</configboolean>
    <configboolean name="append_trailer" desc="Should we append the contents of
    imp/config/trailer.txt to the end of every message
    sent?">true</configboolean>
diff --git a/imp/config/header.php.dist b/imp/config/header.php.dist
deleted file mode 100644 (file)
index 7bde6ec..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * This file will allow you to set headers to append to outgoing mail messages.
- *
- * To add a new header item, simply add a new entry to the $_header array.
- * KEY:   Header name (must be in US-ASCII charset))
- * VALUE: Header data (must be in US-ASCII charset)
- *
- * $Id$
- */
-
-$_header = array(
-
-    // Add information on organization to which the sender belongs.
-    // Not standardized for use in e-mail, but generally recognized.
-    // See RFC 2076 [3.7]; RFC 1036 [2.2.8]
-    //'Organization' => 'Example Corp.',
-
-    // Add the IP of the remote browser
-    //'X-Originating-IP' => $_SERVER['REMOTE_ADDR'],
-
-    // Add the Browser information of the remote browser
-    //'X-Remote-Browser' => $_SERVER['HTTP_USER_AGENT'],
-
-);
index 6092f30..926731d 100644 (file)
@@ -196,7 +196,25 @@ class IMP_Hooks
      */
 //    public function pre_sent($message, $headers)
 //    {
-//        // Do action here -- no return value from this hook.
+//        // Example: Add custom headers to outgoing message.
+//        $charset = $GLOBALS['registry']->getCharset();
+//        $custom_hdrs = array();
+//        $hdr_charset = $message->getHeaderCharset();
+//
+//        /* Add information on organization to which the sender belongs.
+//         * Not standardized for use in e-mail, but generally recognized.
+//         * See RFC 2076 [3.7]; RFC 1036 [2.2.8] */
+//        $custom_hdrs['Organization'] = 'Example Corp.';
+//
+//        // Add the IP of the remote browser
+//        $custom_hdrs['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
+//
+//        // Add the Browser information of the remote browser
+//        $custom_hdrs['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT'];
+//
+//        foreach ($custom_hdrs as $key => $val) {
+//            $headers->addHeader($key, Horde_String::convertCharset($val, $charset, $hdr_charset));
+//        }
 //    }
 
 
index 869dac4..15e7517 100644 (file)
@@ -53,8 +53,8 @@ hook.
 The 'max_from_chars' and 'max_subj_chars' configuration options for the
 minimal (mimp) display have been removed.
 
-The 'cache_folders', 'limit_factor', and 'sort_limit' configuration options
-have been removed.
+The 'cache_folders', 'limit_factor', 'prepend_header', and 'sort_limit'
+configuration options have been removed.
 
 
 Preferences
@@ -84,6 +84,8 @@ The following hooks have been renamed:
 *  x-priority now handled in the core code
 *  old attachment icon handling see atc_flag pref
 *  msglist_flags hook now used to dynamically set flags on messages
+* The headers.php configuration file has been removed; setting custom headers
+  is now done via the 'pre_sent' hook.
 
 
 Fetchmail
index 365ddfe..d99ac63 100644 (file)
@@ -595,23 +595,13 @@ class IMP_Compose
         }
         $headers->addUserAgentHeader();
 
-        /* Tack on any site-specific headers. */
-        try {
-            $headers_result = Horde::loadConfiguration('header.php', '_header');
-            if (is_array($headers_result)) {
-                foreach ($headers_result as $key => $val) {
-                    $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), $GLOBALS['registry']->getCharset(), $charset));
-                }
-            }
-        } catch (Horde_Exception $e) {}
-
-        $sentmail = $GLOBALS['injector']->getInstance('IMP_Sentmail');
-
         /* Send the messages out now. */
         if (!($reply_type = $this->getMetadata('reply_type'))) {
             $reply_type = 'new';
         }
 
+        $sentmail = $GLOBALS['injector']->getInstance('IMP_Sentmail');
+
         foreach ($send_msgs as $val) {
             try {
                 $this->sendMessage($val['to'], $headers, $val['msg']);