Actions
Defect #6423
closedProblem parsing From lines for email account creation
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
2010-09-17
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
The code in mail_handler to create a user via email expects From lines in the form:
"Joe Bloggs <joe.bloggs@example.com>"
It fails to handle the following:
"Bloggs, Joe <joe.bloggs@example.com>"
"joe.bloggs@example.com <joe.bloggs@example.com>"
as the user's firstname cannot contain "," or "@". As a quick fix I've added an extra
line in create_user_from_email in mail_handler.rb to strip those from the firstname
before the user is saved:
user.firstname = names.shift.gsub(/@.*$/, '').gsub(/,/, '')
but this might not cover all cases. I'm just starting with ruby so apologies if this is
hideous code.
regards,
Richard
Actions