(keitai-l) Re: Allowed (Keitai) email address characters

From: Curt Sampson <cjs_at_cynic.net>
Date: 08/29/01
Message-ID: <Pine.LNX.4.33.0108291637090.2776-100000@denkigama.nat.shibuya.blink.co.jp>
On Wed, 29 Aug 2001, Paul Lester wrote:

>     For the longest time I've trusted that working email
> characters are only A-Z (or a-z) 0-9  @ . _ and -.

Nope. And even with those chars, you probably want to do some further
checking to make sure the e-mail address is valid.

Basically, if the local-part of the address (the part before the @ sign)
is not quoted with double-quotes, spaces, control characters and the
following characters are not allowed:

    ( ) < > @ , ; : \ " [ ]

If the local-part is double-quoted, you actually can have any ASCII
character at all in it, though \, " and CR have to be escaped with
a backslash.

Also, note that e-mail addresses are technically case-sensitive.

Likely you will want to be a bit more strict than this, just for ease of
programming if nothing else. For my e-mail address validation, I ignore
case, don't allow quoted local-parts, and also disallow single quotes
in the address.

RFC 822 is the beastie you want to read. You can grab a copy at
http://www.rfc-editor.org/rfc/rfc822.txt .

cjs
-- 
Curt Sampson  <cjs_at_cynic.net>   +81 3 5778 0123   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC


[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Wed Aug 29 10:41:05 2001