summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-13 12:57:52 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-13 12:57:52 +0000
commit5156c3c2cc6d49cf291f8bec208c52ae736eac1a (patch)
tree0d32f7e0c289f816cf563dad2fada47e6ebb1cb7 /roundcubemail/program/steps/mail
parent7c13933277de668a9ca0b11009ce16f566d84a8f (diff)
- Added option to display images in messages from known senders (#1484601)
git-svn-id: https://svn.roundcube.net/trunk@1525 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
-rw-r--r--roundcubemail/program/steps/mail/show.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/show.inc b/roundcubemail/program/steps/mail/show.inc
index 09849734e..ed44edde0 100644
--- a/roundcubemail/program/steps/mail/show.inc
+++ b/roundcubemail/program/steps/mail/show.inc
@@ -45,6 +45,24 @@ if ($_GET['_uid']) {
// calculate Etag for this request
$etag = md5($MESSAGE->uid.$mbox_name.session_id().intval($MESSAGE->headers->mdn_sent).intval($MESSAGE->is_safe).intval($PRINT_MODE));
+ // check known senders to display images
+ if (!$MESSAGE->is_safe
+ && !$_SESSION['safe_messages'][$MESSAGE->uid]
+ && !isset($_GET['_safe'])
+ && $RCMAIL->config->get('addrbook_show_images')
+ && $MESSAGE->has_html_part())
+ {
+ $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
+ $senders = $IMAP->decode_address_list($MESSAGE->headers->from);
+
+ foreach ($senders as $sender)
+ if ($sender['mailto'] && $CONTACTS->search('email', $sender['mailto'], true, false)->count)
+ {
+ $MESSAGE->set_safe();
+ break;
+ }
+ }
+
// allow caching, unless remote images are present
if ((bool)$MESSAGE->is_safe)
send_nocacheing_headers();