GNOME Bugzilla – Bug 554414
Space in front or at end of email addresses prevents mails from being sent
Last modified: 2010-03-11 14:10:54 UTC
Please describe the problem: If you create a contact with leading or trailing spaces in the email address, this will prevent mails to be sent to that contact. Steps to reproduce: 1. Start Evolution 2. Click File > New > Contact to create a new contact 3. Enter contact full name and email address. WHEN TYPING THE EMAIL ADDRESS PUT A SPACE IN FRONT AND AFTER THE EMAIL. 4. Click OK to close contact dialog and create the contact 5. Click File > New > "Mail message" to create a new mail 6. In To: field type the name of the newly created contact. Actual results: Evolution will auto-complete the field with the email address you entered at point 3. Note that THE LEADING AND TRAILING SPACES WILL BE INCLUDED IN THE EMAIL ADDRESS BETWEEN ANGLE BRACKETS. This will cause SMTP servers to reject the address (it happens with gmail servers for sure). Expected results: When user enters leading and trailing spaces in contacts email addresses, these should be stripped away by the program. It's good programming practice to always strip leading and trailing spaces in any input field anyway. Does this happen every time? Yes Other information:
Created attachment 155714 [details] [review] Evolution Addressbook Patch It removes leading and trailing spaces from email while storing them.
Patch is fine for new contacts created in Evolution, but we should also guard against this for existing contacts or new contacts created from other clients. Probably want to patch EDestination to strip spaces wherever "priv->email" gets set.
Fixed the contact editor and also made e_contact_get() strip whitespace off any returned strings. http://git.gnome.org/browse/evolution/commit/?id=7ff2c1327e2bba4b88e8d37107a06cc5da7fd78b http://git.gnome.org/browse/evolution-data-server/commit/?id=baa347bda65b0cf11b6d94e607ac0a864bbc78b4