[SpamCop-List] Re: Plus sign in email address
michael lefevre
spamcop-list@news.spamcop.net
Mon, 20 Jan 2003 13:07:14 +0000 (UTC)
Mike Easter wrote:
> Guy Macon wrote:
>> Newer versions of sendmail accept email addresses with a "+" in them,
>> discarding everything from the "+" to the "@". This has some use in
>> tracking who sells your address and in filtering. Alas, some web
>> forms won't let you enter an email address with a "+" in it. Is there
>> an RFC that I can refer to when asking webmasters to allow email
>> addresses with such a plussed username? I couldn't find a reference
>> when I did a Google search.
>
> It's my understanding that the definition or "rules' are in section 3.4 of
> rfc 2822 which replaces section 6 of rfc 822.
it is indeed.
> A detailed "geek speak" expressing the rules as php regular expression can
> be seen at http://www.trib-design.com/gurututs/validatemail.html -
> Talking GeekSpeek to a Mailbox.
>
> That basically says that you can use numbers, letters [case insensitive],
> underscore, or minus. I don't know where you are going to find
> "permission" for the plus, but maybe it is somewhere in the above places.
it is, and it's a little wider than you might expect (and in fact using
legal addresses can cause some email programs to screw up as well, so
it's wise not to be too quirky, but...). rfc 2822 says:
3.4.1. Addr-spec specification
An addr-spec is a specific Internet identifier that contains a
locally interpreted string followed by the at-sign character ("@",
ASCII value 64) followed by an Internet domain. The locally
interpreted string is either a quoted-string or a dot-atom. If the
string can be represented as a dot-atom (that is, it contains no
characters other than atext characters or "." surrounded by atext
characters), then the dot-atom form SHOULD be used and the
quoted-string form SHOULD NOT be used. Comments and folding white
space SHOULD NOT be used around the "@" in the addr-spec.
addr-spec = local-part "@" domain
local-part = dot-atom / quoted-string / obs-local-part
[snip]
so the local part can either be "dot-atom", which is made up of dots
chunks of any of the following characters, and dots (".") - you can't
start or end with a dot though.
atext = ALPHA / DIGIT / ; Any character except controls,
"!" / "#" / ; SP, and specials.
"$" / "%" / ; Used for atoms
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
the plus sign is in there.
and if you want to go nuts, a quoted-string is also allowed, which can
contain anything except " and \
qtext = NO-WS-CTL / ; Non white space controls
%d33 / ; The rest of the US-ASCII
%d35-91 / ; characters not including "\"
%d93-126 ; or the quote character
so, for example, "me@`$~&%.stu|ff}"@michaellefevre.com is a valid
address.
this is actually a useful trick for newsgroups and forums - if you make
your From: address something like {$}@example.com, then legit email
clients should (although some may fail actually) allow people to reply
without de-munging, while spammer's harvesters fall over.
--
michael