X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=b04b47383a4417afe74473915c5e32522f94ca6d;hb=783e926eb2c99b6a55bdf774b64afa7828e5732b;hp=c79cb323ccf92c582f87bacd941d4af43f294cb3;hpb=c4d486d836c4bfd42b3385574657911aeace3f2b;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index c79cb323..b04b4738 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -255,11 +255,12 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
} else {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp, $pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host);
}
$success = false;
if ($stream) {
@@ -270,7 +271,7 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
$msg = _("Message not sent.") . "\n" .
$deliver->dlv_msg;
if (! empty($deliver->dlv_server_msg)) {
- $msg.= '
' .
+ $msg.= "\n" .
_("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
nl2br(htmlspecialchars($deliver->dlv_server_msg));
}
@@ -307,7 +308,7 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
}
require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
$imap_deliver = new Deliver_IMAP();
- $imap_deliver->mail($composeMessage, $imapConnection, 0, 0, $sent_folder);
+ $imap_deliver->mail($composeMessage, $imapConnection, 0, 0, $imapConnection, $sent_folder);
unset ($imap_deliver);
}
}
@@ -672,7 +673,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
global $base_uri, $where, $what, $show_html_default,
- $oTemplate, $download_href,
+ $oTemplate, $download_href, $PHP_SELF,
$unsafe_image_toggle_href, $unsafe_image_toggle_text;
$urlMailbox = urlencode($mailbox);
@@ -688,38 +689,25 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
}
$url = $base_uri.'src/view_header.php?'.$query_string;
-
- // Build the printer friend link
- /* hackydiehack */
-
- // Pull "view_unsafe_images" from the URL to find out if the unsafe images
- // should be displayed. The default is not to display unsafe images.
- if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
- // If "view_unsafe_images" isn't part of the URL, default to not
- // displaying unsafe images.
- $view_unsafe_images = false;
- } else {
- // If "view_unsafe_images" is part of the URL, display unsafe images
- // regardless of the value of the URL variable.
- // FIXME: Do we really want to display the unsafe images regardless of the value in URL variable?
- $view_unsafe_images = true;
- }
-
- $pf_params = '?passed_ent_id=' . $urlPassed_ent_id .
- '&mailbox=' . $urlMailbox .
- '&passed_id=' . $urlPassed_id .
- '&view_unsafe_images='. (bool) $view_unsafe_images .
- '&show_html_default=' . $show_html_default;
-
$links = array();
$links[] = array (
'URL' => $url,
'Text' => _("View Full Header")
);
- $links[] = array (
- 'URL' => $pf_params,
- 'Text' => _("View Printable Version")
+
+ if ( checkForJavaScript() ) {
+ $links[] = array (
+ 'URL' => 'javascript:printThis();',
+ 'Text' => _("Print"),
);
+ } else {
+ $links[] = array (
+ 'URL' => set_url_var($PHP_SELF, 'print', '1'),
+ 'Text' => _("Print"),
+ 'Target' => '_blank'
+ );
+ }
+
$links[] = array (
'URL' => $download_href,
'Text' => _("Download this as a file")
@@ -963,6 +951,8 @@ if (isset($sendreceipt)) {
/* End of block for handling incoming url vars */
/***********************************************/
+$oTemplate->assign('aAttribs', array('class' => 'entity_sep'));
+$hr = $oTemplate->fetch('horizontal_rule.tpl');
$messagebody = '';
do_hook('read_body_top', $null);
if ($show_html_default == 1) {
@@ -974,7 +964,7 @@ $cnt = count($ent_ar);
for ($i = 0; $i < $cnt; $i++) {
$messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
if ($i != $cnt-1) {
- $messagebody .= '