Skip to Content.
Sympa Menu

devel - [sympa-dev] Sympa does not seem to support "&" in peoples email addresses

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: "Chris Andrews" <address@concealed>
  • To: "address@concealed" <address@concealed>
  • Subject: [sympa-dev] Sympa does not seem to support "&" in peoples email addresses
  • Date: Mon, 14 Jan 2008 12:44:26 -0500

This is from tools.pl

This sub is what checks to make sure the email is valid. I added the
"Regexp" and "Forbidden characters" part because I need to be able to tell
the difference in the logs.

sub valid_email {
my $email = shift;

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

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

return 1;
}

The regexp{'email'} is set with this line:

my %regexp = ('email' =>
'([\w\-\_\.\/\+\=\']+|\".*\")\@[\w\-]+(\.[\w\-]+)+',

I changed the line to (adding \&):

my %regexp = ('email' =>
'([\w\-\_\.\/\+\=\'\&]+|\".*\")\@[\w\-]+(\.[\w\-]+)+',

I restart the web and server procs and now I can subscribe, unsubscribe send
messages, etc. email addresses with "&" in them. Are there any places in
Sympa that could choke on this & char?

Also, couldn't the "sub valid_email" be shortened, as the regexp pretty much
assures us that the invalid chars cannot be put into email addresses.

sub valid_email {
my $email = shift;

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

return 1;
}

I can put in a bug if you guys thin this is a good idea.

---
Chris Andrews
Boston College
Collaboration Team

Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.19+.

Top of Page