in reply to New Module Consideration?
Use a built-in check for valid email
I quote from perlfaq9:
Without sending mail to the address and seeing whether there's a human on the other hand to answer you, you cannot determine whether a mail address is valid. Even if you apply the mail header standard, you can have problems, because there are deliverable addresses that aren't RFC-822 (the mail header standard) compliant, and addresses that aren't deliverable which are compliant.
Many are tempted to try to eliminate many frequently-invalid mail addresses with a simple regex, such as /^[\w.-]+\@(?:[\w-]+\.)+\w+$/. It's a very bad idea. However, this also throws out many valid ones, and says nothing about potential deliverability, so it is not sug- gested. Instead, see http://www.cpan.org/authors/Tom_Christiansen/scripts/ckaddr.gz, which actually checks against the full RFC spec (except for nested comments), looks for addresses you may not wish to accept mail to (say, Bill Clinton or your postmaster), and then makes sure that the hostname given can be looked up in the DNS MX records. It's not fast, but it works for what it tries to do.
The RFC compliancy test is nice, but allows more than most people want to. What kind of test does your built-in do?
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: New Module Consideration?
by Aristotle (Chancellor) on Jan 01, 2003 at 02:39 UTC | |
by Flame (Deacon) on Jan 01, 2003 at 16:08 UTC | |
by poj (Abbot) on Jan 01, 2003 at 17:51 UTC | |
by Flame (Deacon) on Jan 01, 2003 at 17:55 UTC | |
by poj (Abbot) on Jan 01, 2003 at 18:03 UTC | |
by Aristotle (Chancellor) on Jan 01, 2003 at 17:38 UTC | |
by Abigail-II (Bishop) on Jan 03, 2003 at 14:14 UTC | |
Re^2: New Module Consideration?
by diotalevi (Canon) on Jan 01, 2003 at 15:45 UTC | |
by Flame (Deacon) on Jan 01, 2003 at 15:58 UTC | |
by diotalevi (Canon) on Jan 03, 2003 at 00:05 UTC | |
Re: Re: New Module Consideration?
by Flame (Deacon) on Dec 31, 2002 at 23:32 UTC |