Skip to Content.
Sympa Menu

en - RE: Re: [sympa-users] user@domain addresses

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Meie Mees <address@concealed>
  • To: address@concealed
  • Cc:
  • Subject: RE: Re: [sympa-users] user@domain addresses
  • Date: Wed, 19 Jan 2011 14:51:09 +0200

> I'm not sure to understand what your problem is. As long as I
remember,
> Sympa parses addresses on the basis of a regular expression and that's

> it. I know that's not perfect as email addresses are built based on a

> grammar but it works.
> Could you provide a real example of a rejected address?
>
> Alos, what modifiaction did you do on tools.pm? This would help us
> understand your issue, I think.
>

Real addresses in form of user@domain were rejected, for example:
cacti@internal
These are the quick hacks I made to tools.pm:

--- tools.pm
+++ tools.pm
@@ -50,7 +50,7 @@
## Regexps for list params
## Caution : if this regexp changes (more/less parenthesis), then
regexp using it should
## also be changed
-my %regexp = ('email' =>
'([\w\-\_\.\/\+\=\'\&]+|\".*\")\@[\w\-]+(\.[\w\-]+)+',
+my %regexp = ('email' =>
'([\w\-\_\.\/\+\=\'\&]+|\".*\")\@([\w\-]+|[\w\-]+(\.[\w\-]+)+)',
'family_name' => '[a-z0-9][a-z0-9\-\.\+_]*',
'template_name' => '[a-zA-Z0-9][a-zA-Z0-9\-\.\+_\s]*', ##
Allow \s
'host' => '[\w\.\-]+',
@@ -2438,13 +2438,13 @@
my $email = shift;

unless ($email =~ /^$regexp{'email'}$/) {
- do_log('err', "Invalid email address '%s'", $email);
+ do_log('err', "Invalid email address (regexp) '%s'", $email);
return undef;
}

## Forbidden characters
if ($email =~ /[\|\$\*\?\!]/) {
- do_log('err', "Invalid email address '%s'", $email);
+ do_log('err', "Invalid email address (chars) '%s'", $email);
return undef;
}




Archive powered by MHonArc 2.6.19+.

Top of Page