</configsection>
<configtab name="compose" desc="Compose">
- <configsection name="msg">
- <configboolean name="append_trailer" desc="Should we append the contents of
- imp/config/trailer.txt to the end of every message
- sent?">true</configboolean>
- </configsection>
-
<configsection name="compose">
<configboolean name="allow_receipts" desc="Can the user request a return
receipt?">true</configboolean>
/**
- * Dynamically set/alter the contents of the message trailer text.
- *
- * @param string $trailer The default trailer text.
+ * Dynamically create the contents of the message trailer text.
*
* @return string The trailer text to be used.
*/
-// public function trailer($trailer)
+// public function trailer()
// {
-// // Example #1: Set the trailer from the system taglines file; the
-// // string "%TAG%" (if present in a user's signature) will be replaced
-// // by the content of the file "/usr/share/tagline" (generated by the
-// // "TaRT" utility).
-// if (preg_match('/%TAG%/', $trailer)) {
-// $tag = `cat /usr/share/tagline`;
-// $sig = preg_replace('|%TAG%|', $tag, $trailer);
-// }
+// // Example #1: Static trailer text.
+// return "--------------------------------\n" .
+// "This message was sent using IMP.";
//
-// return $trailer;
+//
+// // Example #2: Set the trailer from the system taglines file,
+// // located at "/usr/share/tagline" (generated by the "TaRT" utility;
+// // See: http://sourceforge.net/projects/linuxtart/).
+// return file_get_contents('/usr/share/tagline');
//
//
-// // Example #2: Set the trailer using the LDAP directory for each
-// // domain. This code replaces the current trailer with the data
-// // in 'ispmanDomainSignature'.
+// // Example #3: Set the trailer using the LDAP directory (entry
+// // 'ispmanDomainSignature').
// $vdomain = Horde_String::lower(preg_replace('|^.*?\.|i', '', getenv('HTTP_HOST')));
// $ldapServer = 'localhost';
// $ldapPort = '389';
+++ /dev/null
-
-----------------------------------------------------------------
-This message was sent using IMP, the Internet Messaging Program.
The 'max_from_chars' and 'max_subj_chars' configuration options for the
minimal (mimp) display have been removed.
-The 'cache_folders', 'limit_factor', 'prepend_header', and 'sort_limit'
-configuration options have been removed.
+The 'append_trailer', 'cache_folders', 'limit_factor', 'prepend_header', and
+'sort_limit' configuration options have been removed.
Preferences
* 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.
+* Setting message trailers is now done entirely within the 'trailer' hook.
Fetchmail
$body = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body, 'Html2text', array('wrap' => false, 'charset' => $charset));
}
- /* Get trailer message (if any). */
- $trailer = $trailer_file = null;
- if (empty($options['nofinal']) &&
- $GLOBALS['conf']['msg']['append_trailer']) {
- if (empty($GLOBALS['conf']['vhosts'])) {
- if (is_readable(IMP_BASE . '/config/trailer.txt')) {
- $trailer_file = IMP_BASE . '/config/trailer.txt';
- }
- } elseif (is_readable(IMP_BASE . '/config/trailer-' . $GLOBALS['conf']['server']['name'] . '.txt')) {
- $trailer_file = IMP_BASE . '/config/trailer-' . $GLOBALS['conf']['server']['name'] . '.txt';
- }
-
- if (!empty($trailer_file)) {
- $trailer = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter("\n" . file_get_contents($trailer_file), 'environment');
- try {
- $trailer = Horde::callHook('trailer', array($trailer), 'imp');
- } catch (Horde_Exception_HookNotSet $e) {}
-
- $body .= $trailer;
- if (!empty($options['html'])) {
- $body_html .= $this->text2html($trailer);
+ /* Get trailer text (if any). */
+ if (empty($options['nofinal'])) {
+ try {
+ if ($trailer = Horde::callHook('trailer', array(), 'imp')) {
+ $body .= $trailer;
+ if (!empty($options['html'])) {
+ $body_html .= $this->text2html($trailer);
+ }
}
- }
+ } catch (Horde_Exception_HookNotSet $e) {}
}
/* Set up the body part now. */