diff options
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/show.inc | 1 | ||||
-rw-r--r-- | program/steps/mail/viewsource.inc | 15 |
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 |