diff options
author | ivan <ivan> | 2006-04-14 11:55:58 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-04-14 11:55:58 +0000 |
commit | 2a2173b5c05b1273f3990ee5b914a2d9efac0c3f (patch) | |
tree | caddaa7361f2784d2f59be15fc1be273d1d54f40 /FS | |
parent | b5b3d4ad4663657fcc980ed8c421b3558d4b7482 (diff) |
add the svc_forward-arbitrary_dst flag to enable arbitrary svc_forward destinations
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/svc_forward.pm | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index c33f68b6c..21e752867 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -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; diff --git a/FS/FS/svc_forward.pm b/FS/FS/svc_forward.pm index 12b556f33..ab24d3277 100644 --- a/FS/FS/svc_forward.pm +++ b/FS/FS/svc_forward.pm @@ -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(''); } |