From: ivan Date: Fri, 14 Apr 2006 11:55:58 +0000 (+0000) Subject: add the svc_forward-arbitrary_dst flag to enable arbitrary svc_forward destinations X-Git-Tag: BEFORE_FINAL_MASONIZE~172 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=2a2173b5c05b1273f3990ee5b914a2d9efac0c3f add the svc_forward-arbitrary_dst flag to enable arbitrary svc_forward destinations --- 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(''); }