diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 9feb767cd..920eb80bf 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -773,7 +773,7 @@ function rcmail_check_safe(&$message) // get default addressbook, like in addcontact.inc $CONTACTS = $RCMAIL->get_address_book(-1, true); - if ($CONTACTS) { + if ($CONTACTS && $message->sender['mailto']) { $result = $CONTACTS->search('email', $message->sender['mailto'], 1, false); if ($result->count) { $message->set_safe(true); diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index af43fc87c..e5bfcf087 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -329,7 +329,7 @@ function rcmail_contact_exists($email) $CONTACTS = $RCMAIL->get_address_book(-1, true); if (is_object($CONTACTS)) { - $existing = $CONTACTS->search('email', $email, true, false); + $existing = $CONTACTS->search('email', $email, 1, false); if ($existing->count) { return true; }