[vhffs-dev] [643] Changed some regexp to allow destruction of mailboxes and forwards having dots in the name .

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 643
Author:   crafty
Date:     2007-06-12 17:01:08 +0000 (Tue, 12 Jun 2007)

Log Message:
-----------
Changed some regexp to allow destruction of mailboxes and forwards having dots in the name. Removed some "A-Z" in mailboxes and forwards regexp

Modified Paths:
--------------
    branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm
    trunk/vhffs-api/src/Vhffs/Services/Mail.pm


Modified: branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 16:46:38 UTC (rev 642)
+++ branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 17:01:08 UTC (rev 643)
@@ -421,7 +421,7 @@
 	my $name = shift;
 
 	return -1 if( ! defined $name );
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-\.]+$/ ) );
 
 	undef $self->{boxes}{$name};
 
@@ -440,7 +440,7 @@
 	return -1 if( ! defined $name );
 
 	undef $self->{forward}{$name};
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-\.]+$/ ) );
 
 	my $query = "DELETE FROM vhffs_forward WHERE local_part='".$name."' AND domain='".$self->{'domain'}."'";
 	my $request = $self->{'db'}->{'DB_WRITE'}->prepare( $query );
@@ -469,7 +469,7 @@
 {
 	my $self = shift;
 	my $name = shift;
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-\.]+$/ ) );
     my $request = $self->{'db'}->{'DB_READ'}->prepare("SELECT * FROM vhffs_forward where domain='".$self->{'domain'}."' AND local_part='".$name."'") or return -1;
     return 1 if( $request->execute() > 0 );
 	return 0;
@@ -479,7 +479,7 @@
 {
 	my $self = shift;
 	my $name = shift;
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-\.]+$/ ) );
     my $request = $self->{'db'}->{'DB_READ'}->prepare("SELECT * FROM vhffs_boxes where domain='".$self->{'domain'}."' AND local_part='".$name."'") or return -1;
     return 1 if( $request->execute() > 0 );
 	return 0;

Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 16:46:38 UTC (rev 642)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 17:01:08 UTC (rev 643)
@@ -308,7 +308,7 @@
 	my $self = shift;
 	my $name = shift;
 
-	return -1 unless( defined $name && ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 unless( defined $name && ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
 
 	undef $self->{boxes}{$name};
 
@@ -324,7 +324,7 @@
 	my $self = shift;
 	my $name = shift;
 
-	return -1 unless( defined $name  && ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 unless( defined $name  && ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
 	undef $self->{forward}{$name};
 
 	my $query = "DELETE FROM vhffs_forward WHERE local_part='".$name."' AND domain='".$self->{'domain'}."'";
@@ -354,7 +354,7 @@
 {
 	my $self = shift;
 	my $name = shift;
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
     my $request = $self->{'db'}->prepare("SELECT * FROM vhffs_forward where domain='".$self->{'domain'}."' AND local_part='".$name."'") or return -1;
     return 1 if( $request->execute() > 0 );
 	return 0;
@@ -364,7 +364,7 @@
 {
 	my $self = shift;
 	my $name = shift;
-	return -1 if( ! ( $name =~ /^[a-zA-Z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
     my $request = $self->{'db'}->prepare("SELECT * FROM vhffs_boxes where domain='".$self->{'domain'}."' AND local_part='".$name."'") or return -1;
     return 1 if( $request->execute() > 0 );
 	return 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/