[OT]Mail::* Perl modules to validate email address (RFC822)
hello, sorry for the OT, but I guess/hope the knowledge I'm looking for is not completely unrelated to this particular list, and I'm not aware of any Perl-email related mailing list. I'm trying to validate an email address as per RFC822, and, even though I've seen a lot of quick'n'dirty regexps to do so, I'd like to use actually RFC compliant code, known to work. Right now I'm perusing the Mail::* modules (docs and code), just grabbed from CPAN, looking for validating code, and finding none whatsoever. Has anyone experience with this modules? As far as I can see, they are too high-level for what I'm looking for. Or maybe I'm wrong? martin
Re: [OT]Mail::* Perl modules to validate email address (RFC822)
martin langhoff [EMAIL PROTECTED] writes: I'm trying to validate an email address as per RFC822, and, even though I've seen a lot of quick'n'dirty regexps to do so, I'd like to use actually RFC compliant code, known to work. Right now I'm perusing the Mail::* modules (docs and code), just grabbed from CPAN, looking for validating code, and finding none whatsoever. Has anyone experience with this modules? Doesn't Mail::RFC822 have validation code? I thought it did. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/
Re: [OT]Mail::* Perl modules to validate email address (RFC822)
On Mon, Aug 14, 2000 at 12:31:07PM -0700, Russ Allbery wrote: martin langhoff [EMAIL PROTECTED] writes: I'm trying to validate an email address as per RFC822, and, even though I've seen a lot of quick'n'dirty regexps to do so, I'd like to use actually RFC compliant code, known to work. Right now I'm perusing the Mail::* modules (docs and code), just grabbed from CPAN, looking for validating code, and finding none whatsoever. Has anyone experience with this modules? Doesn't Mail::RFC822 have validation code? I thought it did. No, but Mail::Address [1] or RFC::RFC822::Address [2] /magnus [1] http://www.perl.com/CPAN/authors/id/GBARR/MailTools-1.1401.tar.gz [2] http://www.perl.com/CPAN/authors/id/ABIGAIL/RFC_RFC822_Address-1.4.tgz -- http://x42.com/
Re: [OT]Mail::* Perl modules to validate email address (RFC822)
list, silly me. read the faqs first! perlfaq9 tells me I cannot validate emails in such a way, and points to a possible (but imperfect) approach by t.christiansen. off I go, to see if that's useable. sorry for everybody's time and bandwidth. martin pd: I did reply to myself so the (partial) answer gets to the archives and we all let this thread die.
Re: [OT]Mail::* Perl modules to validate email address (RFC822)
Magnus Bodin wrote: Doesn't Mail::RFC822 have validation code? I thought it did. No, but Mail::Address [1] or RFC::RFC822::Address [2] are you sure? I've been looking at Mail::Address and found nothing in its code that hinted of ay validation. It looked like an 'address book' mechanism, that built objects with a human-readable name and an address, and provided a few functions on that. Not much more, and certainly not any validation I could see. as per `perldoc perlfaq9` there's no realiable way to tell a functioning email address from a functioning diesel engine until you actually send it. martin
Re: [OT]Mail::* Perl modules to validate email address (RFC822)
On Mon, Aug 14, 2000 at 08:04:48PM -0300, martin langhoff wrote: Magnus Bodin wrote: Doesn't Mail::RFC822 have validation code? I thought it did. No, but Mail::Address [1] or RFC::RFC822::Address [2] are you sure? I've been looking at Mail::Address and found nothing in its code that hinted of ay validation. It looked like an 'address book' mechanism, that built objects with a human-readable name and an address, and provided a few functions on that. Not much more, and certainly not any validation I could see. OK. I didn't check if it explicitly had a function called "validate" but I checked the source of both these packages and both are able to _parse_ such an address. as per `perldoc perlfaq9` there's no realiable way to tell a functioning email address from a functioning diesel engine until you actually send it. You _can_ tell if it's well formed. But on the other hand, all these addresses are valid: %20 + [EMAIL PROTECTED] or alternatively "%20 + %20"@x42.com "\@x42.comor alternatively "\"\\"@x42.com at@at@[EMAIL PROTECTED] or alternatively "at@at@at"@x42.com You can also do a MX check to see if there is a receiving party at all for the domain mail. What you cannot check is whether the receiving party likes the local part (or accepts mail whatsoever, the MX may be misleading) or not. /magnus -- http://x42.com/