Project

General

Profile

Actions

Defect #6423

closed

Problem parsing From lines for email account creation

Added by Richard Palmer over 14 years ago. Updated about 6 years ago.

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 <>"

It fails to handle the following:

"Bloggs, Joe <>" 
" <>"

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

Also available in: Atom PDF