Julian Mehnle writes:
I think adding such checks and issuing a syntax error in the
<xyz@domain'> case would be the way to go. But maybe there's a good
reason why Courier doesn't do that?
Well, I don't think you'd have too much trouble sticking an apostrophe
into a hostname in DNS. If you really wanted to, I think you could
set up an MX record for foo'bar.example.com.
Weren't we earlier arguing for standards compliance? I don't have a DNS
server I'm willing to perturb to try this, but you cannot register a domain
name with anything other than Alphanumeric & a "-"
But that's a stretch. Obviously apostrophes are invalid, however I
don't want to start keeping track of which characters are valid in
DNS, and which ones aren't. You'll never get this right.
I think you are looking at:
isalpha(x) || isdigit(x) || (x=='.') || (x=='-')
I could swear I've seen domain names with underscores in them, but now that
I'm looking, I can't seem to locate one.
What might be the better solution is to change the error message when a
message gets rejected so that the end-user gets a hint as to the likely
problem.
Rather than saying:
<'fo...@bar.com'>:
<<< No such domain.
---------
<'fo...@bar.com'>:
<<< No such domain "bar.com'"
<<< note: only A-Z, 0-9 and dash are allowable characters in a domain name