Dr J R Stockton wrote:
Hi John,
That was not the question.
Neither was that.
Yes, the information I have provided did not answer to the exact
question. However, I had the feeling that this original question had
some issues itself, and that explaining these could help the OP into
getting a better overview of his process. Still, offering a caveat
without providing the straight answer was, as you suggested, probably
some mistake from my side.
Collecting email addresses generally exposes some will to use them in
the future. A valid email address should not only respect a certain
format, but should also reach its recipient. Unfortunately, most people
tend to believe that testing for some particular format suffices (and to
me the OQ was a potential expression of this syndrome), potentially
building critical processes on unchecked data.
Also, when designing an application, one should nearly never request the
user to enter some input that is already predefined. Doing so can only
confuse the user and slow down his inputting data.
Whatever the OP may have meant, the question requires that all mail not
addressed to a specific domain be disallowed.
Which is why I proposed an alternate approach, not using a regular
expression, but rather forcing the domain as plain text and simply
requesting the local part of the address...
All mail addressed to the domain which I am now using will have "merlyn"
in the address; but so will mail to Joe.merlyn (*at) elsewhere.kom.
Mail addressed to the domain will necessarily have a particular right
part.
That is true, and most of the time people providing their email address
would not complicate it using inappropriate subtleties, which should
eventually make this 'right part' not too complicated to spot - though
in regards of the possibilities permitted by the RFC, a regular
expression alone is probably not enough to spot it safely.
One might attempt to address mail to the dotted quad - would that count
as the domain?
If by "dotted quad" you refer to the IP address, then yes, that would
indeed count as the domain.
Mail addressed to my name in another domain will be redirected to my
domain; the OP could allow mail to that other domain, but it redirects
in many directions.
Quite an interesting point, but if some non AOL address redirects to the
AOL one, then why not supply the AOL one in the first place? What if the
user eventually switches email? Would this make him/her still a target?
To which extent is the email a relevant criteria?
Kind regards,
Elegie.