On Wed, 3 Jul 2002, Werner Reisberger wrote:
I am looking for a regexp usable in a procmail recipe which checks if
an email address is valid according to rfc822.
I've had something for this sitting around for a while, so I tossed it up
on the web:
http://www.well.com/user/barts/email/rfc822rc.txt
It's essentially a translation of the RFC822 address grammer into a regex,
broken up as variables for readability.
Doesn't include the recursive INCLUDERC that would be necessary to strip
out parenthesized comments, though.
One exception of rfc822 could be that the local-part is not composed of
characters within double quotes. I also don't want to allow a domain
part consisting of an IP address.
In the above, to exclude quoted strings, change the definition of the
$word__ variable; to exclude domain literals, change $subdomain__. It
should be pretty obvious what changes to make.
Then you'd use something like
* $ subscraddr ?? $mailbox__
Or perhaps
* $ subscraddr ?? $addrspec__
(The double trailing underscores are to lessen the chance of collision
with somebody else's variable names.)
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail