roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.78k stars 1.62k forks source link

Contacts import: Contacts with "invalid" e-mail address silently dropped #9591

Open respiranto opened 3 weeks ago

respiranto commented 3 weeks ago

Prerequisites

Describe the issue

When importing contacts from a vCard file, any vcard object that contains an "invalid" e-mail address (as per rcube_utils::check_email(), I believe), the vcard object is silently ignored.

Example (note that vCard mandates CRLF as newline sequence):

BEGIN:VCARD
VERSION:3.0
N:Doe;Jane;;;
FN:Jane Doe
EMAIL:invalid
END:VCARD

I would expect an error or warning message indicating that some contacts failed to import and why. Optionally, the contact could be imported without the offending e-mail address value.

Note: Creating or modifying a contact via the Roundcube web UI to have an "invalid" e-mail address fails with the error message "Invalid email address: [...]".

The current situation is particularly problematic when $config['email_dns_check'] = true, and when previously existing e-mail addresses' domains no longer exist. In such a case (which is how I found this bug), a contacts export followed by an import will silently fail to recreate the same addressbook.


Maybe related: #4198


Originally reported at the Debian BTS as Bug 1078774, where I was asked to report the bug here instead. The bug report has slightly changed.

What browser(s) are you seeing the problem on?

Firefox

What version of PHP are you using?

v8.2

What version of Roundcube are you using?

master / 58721e3037671888f82d75fd8e91a8622405af45

JavaScript errors

No response

PHP errors

No response

alecpl commented 3 weeks ago

Even if we import such a contact with removed email address (which is now possible) we should still display a notice to the user.

I think we should not import such contacts. We should add a list of invalid contacts in the import summary.