From 9ab0d96f1bf94b7110b2d4c76485317500ab9eb1 Mon Sep 17 00:00:00 2001 From: teepe Date: Sun, 11 Nov 2001 13:34:59 +0000 Subject: [PATCH] integrated xmailer plugin git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1725 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/load_prefs.php | 3 ++- src/options.php | 1 + src/options_display.php | 7 +++++++ src/read_body.php | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/load_prefs.php b/src/load_prefs.php index a28d18dc..377338e6 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -188,11 +188,12 @@ $location_of_bar = getPref($data_dir, $username, 'location_of_bar', SMPREF_LOC_LEFT); $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons', SMPREF_LOC_BETWEEN); - global $collapse_folders, $show_html_default; + global $collapse_folders, $show_html_default, $show_xmailer_default; $collapse_folders = getPref($data_dir, $username, 'collapse_folders', SMPREF_ON); /* show_html_default is a int value. */ $show_html_default = intval(getPref($data_dir, $username, 'show_html_default', SMPREF_ON)); + $show_xmailer_default = intval(getPref($data_dir, $username, 'show_xmailer_default', SMPREF_OFF ) ); global $include_self_reply_all; $include_self_reply_all = getPref($data_dir, $username, 'include_self_reply_all', SMPREF_ON); diff --git a/src/options.php b/src/options.php index d60d4eaf..cbbfb261 100644 --- a/src/options.php +++ b/src/options.php @@ -95,6 +95,7 @@ setPref($data_dir, $username, 'include_self_reply_all', $new_include_self_reply_all); setPref($data_dir, $username, 'page_selector', $new_page_selector); setPref($data_dir, $username, 'page_selector_max', $new_page_selector_max); + setPref($data_dir, $username, 'show_xmailer_default', $new_show_xmailer_default); $js_autodetect_results = (isset($new_js_autodetect_results) ? $new_js_autodetect_results : SMPREF_JS_OFF); if ($new_javascript_setting == SMPREF_JS_AUTODETECT) { diff --git a/src/options_display.php b/src/options_display.php index f1ab70bf..4df209c5 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -196,6 +196,13 @@ 'refresh' => SMOPT_REFRESH_NONE ); + $optvals[] = array( + 'name' => 'show_xmailer_default', + 'caption' => _("Show the Mailer of incoming messages"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + /* Build all these values into an array of SquirrelOptions objects. */ $options = createOptionArray($optvals); diff --git a/src/read_body.php b/src/read_body.php index 421a4489..8fda0972 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -488,6 +488,23 @@ " " . "\n"; } } + if ($show_xmailer_default) { + fputs ($imapConnection, sqimap_session_id() . + " FETCH $passed_id BODY.PEEK[HEADER.FIELDS (X-Mailer)]\r\n"); + $read = sqimap_read_data ($imapConnection, sqimap_session_id(), true, + $response, $readmessage); + $mailer = substr($read[1], strpos($read[1], " ")); + if (trim($mailer)) { + echo " \n" . + " \n" . + " "._("Mailer").": \n". + " \n" . + " $mailer \n" . + " " . "\n" . + " " . "\n"; + } + } + do_hook("read_body_header"); echo '' . ' ' . -- 2.25.1