# Copyright 2005-2009 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.

CodeDef email_only OrderCheck 1
CodeDef email_only Description Email address
CodeDef email_only Routine <<EOR
sub {
	my($ref, $var, $val, $msg) = @_;
	if($val and $val =~ /^[\040-\053\055-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
		return (1, $var, '');
	}
	else {
		return (undef, $var,
			$msg || errmsg("'%s' not an email address", $val )
		);
	}
}
EOR
