summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-23 14:17:07 +0000
committeralecpl <alec@alec.pl>2009-05-23 14:17:07 +0000
commit49dfb0047a53758a3e12699cf6e0b4da55aefd3e (patch)
tree48bb85d6fb196aa4cee9e7f382a776a5efd8f176 /program/steps/mail
parent569654a8c350de5b34cb65ae561bf95418b15f1c (diff)
- Added message menu (some image needed), removed Print and Source buttons
- Added possibility to save message as .eml file (#1485861)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/show.inc1
-rw-r--r--program/steps/mail/viewsource.inc15
2 files changed, 15 insertions, 1 deletions
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 9beb42521..06c9f53e5 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -65,7 +65,6 @@ if ($_GET['_uid']) {
// set environement
$OUTPUT->set_env('safemode', $MESSAGE->is_safe);
$OUTPUT->set_env('sender', $MESSAGE->sender['string']);
- $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
$OUTPUT->set_env('mailbox', $mbox_name);
if ($CONFIG['trash_mbox'])
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
diff --git a/program/steps/mail/viewsource.inc b/program/steps/mail/viewsource.inc
index 6971e0c8a..87908303d 100644
--- a/program/steps/mail/viewsource.inc
+++ b/program/steps/mail/viewsource.inc
@@ -26,6 +26,21 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
$headers = $IMAP->get_headers($uid);
$charset = $headers->charset ? $headers->charset : $IMAP->default_charset;
header("Content-Type: text/plain; charset={$charset}");
+
+ if (!empty($_GET['_save'])) {
+ $filename = ($headers->subject ? $headers->subject : 'roundcube') . '.eml';
+ $browser = new rcube_browser;
+
+ if ($browser->ie && $browser->ver < 7)
+ $filename = rawurlencode(abbreviate_string($filename, 55));
+ else if ($browser->ie)
+ $filename = rawurlencode($filename);
+ else
+ $filename = addcslashes($filename, '"');
+
+ header("Content-Disposition: attachment; filename=\"$filename\"");
+ }
+
$IMAP->print_raw_body($uid);
}
else