Email recipient address not trimmed #2467

Closed
rcubetrac opened this Issue Oct 10, 2009 · 3 comments

1 participant

@rcubetrac

Reported by p sunthar on 10 Oct 2009 13:05 UTC as Trac ticket #1486214

Version 0.3 Stable

Problem:
When vCards are imported by the addressbook, the email address is not trimmed. The decoder expects the email address to immediately follow the ':' (colon) without any space(s). If there is a space then the email is inserted into the database table along with the space. It is not trimmed.

Programs such as csv2vcard.rb however insert a space in between. Example
BEGIN:VCARD
FN: Space Committee
N: Space Committee
EMAIL;INTERNET: Space@domain.com
END:VCARD

When an email is composed to this address it is inserted as
"Space Committee" < Space@domain.com>
which is an invalid address, and the client asks to "specify at least one recipient".

Solution:
Rewrite the vcard_decode() in rcube_vcard.php

A more general fix would be to trim all email addresses before they are sent to the client in main.inc (there by avoiding bugs of several programs that may write to the database table).

<?php
function format_email_recipient($email, $name='')
{
$email = trim($email); // trim all addresses here
if ($name && $name != $email)

?>

Keywords: address, leading space, trim
Migrated-From: http://trac.roundcube.net/ticket/1486214

@rcubetrac

Milestone changed by @alecpl on 10 Oct 2009 13:32 UTC

later => 0.3.1

@rcubetrac

Comment by @alecpl on 12 Oct 2009 09:44 UTC

Fixed in a9bfe21.

@rcubetrac

Status changed by @alecpl on 12 Oct 2009 09:44 UTC

new => closed

@rcubetrac rcubetrac closed this Oct 12, 2009
@rcubetrac rcubetrac added this to the 0.3.1 milestone Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment