add the svc_forward-arbitrary_dst flag to enable arbitrary svc_forward destinations
authorivan <ivan>
Fri, 14 Apr 2006 11:55:58 +0000 (11:55 +0000)
committerivan <ivan>
Fri, 14 Apr 2006 11:55:58 +0000 (11:55 +0000)
FS/FS/Conf.pm
FS/FS/svc_forward.pm

index c33f68b..21e7528 100644 (file)
@@ -1695,6 +1695,13 @@ httemplate/docs/config.html
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'svc_forward-arbitrary_dst',
+    'section'     => '',
+    'description' => "Allow forwards to point to arbitrary strings that don't necessarily look like email addresses.  Only used when using forwards for weird, non-email things.",
+    'type'        => 'checkbox',
+  },
+
 );
 
 1;
index 12b556f..ab24d32 100644 (file)
@@ -257,9 +257,15 @@ sub check {
   }
 
   if ( $self->dst ) {
-    $self->dst =~ /^([\w\.\-\&]*)(\@([\w\-]+\.)+\w+)$/
-       or return "Illegal dst: ". $self->dst;
-    $self->dst("$1$2");
+    my $conf = new FS::Conf;
+    if ( $conf->exists('svc_forward-arbitrary_dst') ) {
+      my $error = $self->ut_textn('dst');
+      return $error if $error;
+    } else {
+      $self->dst =~ /^([\w\.\-\&]*)(\@([\w\-]+\.)+\w+)$/
+         or return "Illegal dst: ". $self->dst;
+      $self->dst("$1$2");
+    }
   } else {
     $self->dst('');
   }