Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow remote resources "from my contacts" and"from trusted senders" mixed up #8177

Closed
Player701 opened this issue Aug 25, 2021 · 1 comment
Closed

Comments

@Player701
Copy link
Contributor

In the settings form, "from my contacts" is 3 and "from trusted senders" is 1:

$input->add($rcmail->gettext('never'), 0);
$input->add($rcmail->gettext('frommycontacts'), 3);
$input->add($rcmail->gettext('fromtrustedsenders'), 1);
$input->add($rcmail->gettext('always'), 2);

However, in function check_safe, "from my contacts" is assumed to be 1 and "from trusted senders" is assumed to be 3. This creates confusing behavior.
switch ($show_images) {
case 1: // all my contacts
case 3: // trusted senders only
if (!empty($message->sender['mailto'])) {
$type = rcube_addressbook::TYPE_TRUSTED_SENDER;
if ($show_images == 1) {
$type |= rcube_addressbook::TYPE_RECIPIENT | rcube_addressbook::TYPE_WRITEABLE;
}
if ($rcmail->contact_exists($message->sender['mailto'], $type)) {
$message->set_safe(true);
}
}

In addition to the above, it appears that a contact cannot be added to the trusted senders list if the same address is already present in the main addressbook (it says that the address already exists). This should probably be resolved somehow (I can file a separate issue on this matter, if necessary).

@alecpl
Copy link
Member

alecpl commented Aug 26, 2021

Fixed.

@alecpl alecpl closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants