Bugzilla@Mozdev – Bug 25083
%from([first|last]name)% should reformat "Lastname, Firstname"
Last modified: 2013-06-05 07:56:59
You need to
before you can comment on or make changes to this bug.
A lot of emails I get are from a sender where the From line says something
"Doe, John - USDA" <john.doe@USDA.gov>
When I use %from(firstname)%, it picks out "Doe". Please teach it that if
there is a comma in the friendly name, that the text before the comma is the
lastname and the text after the comma is the firstname. Thanks.
I experience the same problem.
Please add "%from(lastname)%" variable.
our emails is like "Levi, Alexandr <email@example.com>"
so if be able at least parse firstname and lastname - that will solve most of
Or create variable that normalize name from "Levi, Alexandr" to "Levi Alexandr"
it would also help, because "Hello, Levin, Alexandr" look weird.
Sounds simple enough. can you send me a test email to my mail account that uses
this address format? Just put
[SmartTemplate4] - Bug 25083
into the subject line please.
I assume that the requirement is as follows: if the names before the email
address includes a comma, use the following rule
A, B => B A
personally I prefer the first name to come first myself, so that sounds like a
1) Doe, John => John Doe
2) Smith, Mrs. Jane => Mrs. Jane Smith
3) Acme Corporation, Ltd. => Ltd. Acme Corporation
4) Mr Brown, Alex => Alex Mr Brown
5) Elizabeth Taylor, Hollywood Corp => Hollywood Corp Elizabeth Taylor
6) Topley-Bird, Martina Eva => Eva Martina Topley-Bird
Of course it is not possible to make a distinction between cases 1, 2 and 3, as
a real intelligence that distinguishes names from other entities would be out
of scope. It would always assume everything before the comma to be last name
and everything after the comma as first name.
Also, how should it behave if there is more than one comma?
(In reply to comment #4)
> I assume that the requirement is as follows: if the names before the email
> address includes a comma, use the following rule
> A, B => B A
> personally I prefer the first name to come first myself, so that sounds like a
> reasonable request.
> 1) Doe, John => John Doe
> 2) Smith, Mrs. Jane => Mrs. Jane Smith
> 3) Acme Corporation, Ltd. => Ltd. Acme Corporation
> 4) Mr Brown, Alex => Alex Mr Brown
> 5) Elizabeth Taylor, Hollywood Corp => Hollywood Corp Elizabeth Taylor
> 6) Topley-Bird, Martina Eva => Eva Martina Topley-Bird
Ok, here is another apparently common case: Outlook will often place a calling
name in parentheses,e.g.
Grude, Axel (Alex) <firstname.lastname@example.org>
in this case, it appears to be the wish of the sender to be addressed as
'Alex'. Parsing the (suggested) name between the parentheses seems to be quite
a clever additional rule for this case.
Shouldn't this override all firstname, lastname and name rules?
Or just override in the cases of firstname and name?
I think this swapping algorithm should apply to from(name), from(lastname) and
Also I will implement the bracketed expression to be used in the case of (name)
and (firstname). I will probably add another global option to control this
(In reply to comment #0)
> A lot of emails I get are from a sender where the From line says something
> "Doe, John - USDA" <john.doe@USDA.gov>
> When I use %from(firstname)%, it picks out "Doe". Please teach it that if
> there is a comma in the friendly name, that the text before the comma is the
> lastname and the text after the comma is the firstname. Thanks.
totally oversaw your test case! what about from(firstname) or from(name) in
from(firstname) would generate
John - USDA
from(name) would generate
John - USDA Doe
you cannot possibly expect the algorithm to detect the fact that - USDA is not
part of the names (please note there are composite firstnames, such as
John-Patrick, so we cannot just truncate after an unexpected character). This
will get very messy soon.
It would work however with:
Topley-Bird, Christina - Maria
but not so nicely with
Gates, Bill - Microsoft
Created an attachment (id=7562) [details]
0.9.3 prerelease 108
Here is an early implementation of what you suggested. The new behavior can be
disabled by unchecking the option in st4 settings > advanced > global settings
[x] Correct LastName, FirstName
An added (name) expression will override in the case of firstname and name.
In all other (name) cases, the rule
A, B => B A
is applied. It was a couple of hours of work, but might be worth it.
Thanks a lot.
works pretty well so far, I will keep you posted if smth strange happen.
Answer to "Comment #7" (just idea):
Name recognition is out of scope definitely and we will never succeed in this.
But for people with long names are ok to call them by first part only in most
cases. First part is all characters before any non alphabet symbol.
> "Doe, John - USDA" <john.doe@USDA.gov>
from(firstname_short) would generate
from(name_short) would generate
Created an attachment (id=7598) [details]
0.9.3 prerelease 156
Latest prerelease. No changes as far as last, first functionality is concerned,
but it has the ability to take an expression in parens as name, example
john Doe (Joe) email@example.com
%to(name)% => Joe
this is a typical corporate outlook format and is designed to use the Name in
parentheses to address people.
Also, %to(mail)% now supresses the automatic linkification; for a linked email,