initial commit of file from CVS for smeserver-wbl on Sat Sep 7 21:14:56 AEST 2024
This commit is contained in:
415
root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm
Normal file
415
root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/wbl.pm
Normal file
@@ -0,0 +1,415 @@
|
||||
#!/usr/bin/perl -w
|
||||
package esmith::FormMagick::Panel::wbl;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use esmith::FormMagick;
|
||||
use esmith::ConfigDB;
|
||||
use esmith::cgi;
|
||||
use esmith::util;
|
||||
use File::Basename;
|
||||
use Exporter;
|
||||
use Carp qw(verbose);
|
||||
|
||||
our @ISA = qw(esmith::FormMagick Exporter);
|
||||
|
||||
our @EXPORT = qw();
|
||||
|
||||
our $VERSION = sprintf '%d.%03d', q$Revision: 1.1 $ =~ /: (\d+).(\d+)/;
|
||||
|
||||
our $db = esmith::ConfigDB->open() or die "Couldn't open ConfigDB\n";
|
||||
our $wdb = esmith::ConfigDB->open('wbl') or die "Couldn't open wbl dbase\n";
|
||||
our $sdb = esmith::ConfigDB->open('spamassassin') or die "Couldn't open spamassassin dbase\n";
|
||||
|
||||
sub get_dnsbl
|
||||
{
|
||||
return ($db->get_prop('qpsmtpd', 'DNSBL') || 'disabled');
|
||||
}
|
||||
|
||||
sub get_rhsbl
|
||||
{
|
||||
return ($db->get_prop('qpsmtpd', 'RHSBL') || 'disabled');
|
||||
}
|
||||
|
||||
sub get_sbllist
|
||||
{
|
||||
my $sbllistform = $db->get_prop('qpsmtpd', 'SBLList') || '';
|
||||
$sbllistform =~ s/,/\n/g;
|
||||
return $sbllistform;
|
||||
}
|
||||
|
||||
sub get_rbllist
|
||||
{
|
||||
my $rbllistform = $db->get_prop('qpsmtpd', 'RBLList') || '';
|
||||
$rbllistform =~ s/,/\n/g;
|
||||
return $rbllistform;
|
||||
}
|
||||
|
||||
sub get_badhelo
|
||||
{
|
||||
my %list = $wdb->get('badhelo')->props;
|
||||
|
||||
my @badhelo = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "Black") {
|
||||
push @badhelo, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @badhelo);
|
||||
|
||||
return join "\n", sort(@badhelo);
|
||||
}
|
||||
|
||||
sub get_badmailfrom
|
||||
{
|
||||
my %list = $wdb->get('badmailfrom')->props;
|
||||
|
||||
my @badmailfrom = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "Black") {
|
||||
push @badmailfrom, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @badmailfrom);
|
||||
|
||||
return join "\n", sort(@badmailfrom);
|
||||
}
|
||||
|
||||
sub get_whitelisthosts
|
||||
{
|
||||
my %list = $wdb->get('whitelisthosts')->props;
|
||||
|
||||
my @whitelisthosts = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
push @whitelisthosts, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @whitelisthosts);
|
||||
|
||||
return join "\n", sort(@whitelisthosts);
|
||||
}
|
||||
|
||||
sub get_whitelisthelo
|
||||
{
|
||||
my %list = $wdb->get('whitelisthelo')->props;
|
||||
|
||||
my @whitelisthelo = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
push @whitelisthelo, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @whitelisthelo);
|
||||
|
||||
return join "\n", sort(@whitelisthelo);
|
||||
}
|
||||
|
||||
sub get_whitelistsenders
|
||||
{
|
||||
my %list = $wdb->get('whitelistsenders')->props;
|
||||
|
||||
my @whitelistsenders = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
push @whitelistsenders, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @whitelistsenders);
|
||||
|
||||
return join "\n", sort(@whitelistsenders);
|
||||
}
|
||||
|
||||
sub get_whitelistfrom
|
||||
{
|
||||
my %list = $sdb->get('wbl.global')->props;
|
||||
|
||||
my @whitelistfrom = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
push @whitelistfrom, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @whitelistfrom);
|
||||
|
||||
return join "\n", sort(@whitelistfrom);
|
||||
}
|
||||
|
||||
sub create_modify_black
|
||||
{
|
||||
my $fm = shift;
|
||||
my $q = $fm->{'cgi'};
|
||||
|
||||
# qmail badhelo
|
||||
my %list = $wdb->get('badhelo')->props;
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "Black") {
|
||||
$wdb->get_prop_and_delete('badhelo', "$parameter");
|
||||
}
|
||||
}
|
||||
|
||||
my $BadHelo = $q->param("badhelo");
|
||||
$BadHelo =~ s/\r\n/,/g;
|
||||
my @BadHelo = sort(split /,/, $BadHelo);
|
||||
foreach $BadHelo (@BadHelo)
|
||||
{
|
||||
$wdb->set_prop('badhelo', "$BadHelo", 'Black');
|
||||
}
|
||||
|
||||
# qmail badmailfrom
|
||||
my %list_badmailfrom = $wdb->get('badmailfrom')->props;
|
||||
my $parameter_badmailfrom = "";
|
||||
my $value_badmailfrom = "";
|
||||
while (($parameter_badmailfrom,$value_badmailfrom) = each(%list_badmailfrom)) {
|
||||
if ($parameter_badmailfrom eq "type") {next;}
|
||||
|
||||
if ($value_badmailfrom eq "Black") {
|
||||
$wdb->get_prop_and_delete('badmailfrom', "$parameter_badmailfrom");
|
||||
}
|
||||
}
|
||||
|
||||
my $BadMailFrom = $q->param("badmailfrom");
|
||||
$BadMailFrom =~ s/\r\n/,/g;
|
||||
my @BadMailFrom = sort(split /,/, $BadMailFrom);
|
||||
foreach $BadMailFrom (@BadMailFrom){
|
||||
$wdb->set_prop('badmailfrom', "$BadMailFrom", 'Black');
|
||||
}
|
||||
# spamassassin blacklist_from
|
||||
my %list_wblglobal = $sdb->get('wbl.global')->props;
|
||||
my $parameter_wblglobal = "";
|
||||
my $value_wblglobal = "";
|
||||
while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
|
||||
if ($parameter_wblglobal eq "type") {next;}
|
||||
|
||||
if ($value_wblglobal eq "Black") {
|
||||
$sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
|
||||
}
|
||||
}
|
||||
|
||||
my $BlacklistFrom = $q->param("blacklistfrom");
|
||||
$BlacklistFrom =~ s/\r\n/,/g;
|
||||
my @BlacklistFrom = sort(split /,/, $BlacklistFrom);
|
||||
foreach $BlacklistFrom (@BlacklistFrom){
|
||||
$sdb->set_prop('wbl.global', "$BlacklistFrom", 'Black');
|
||||
}
|
||||
|
||||
##Update email settings
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ){
|
||||
$fm->error('ERROR_UPDATING');
|
||||
return undef;
|
||||
}
|
||||
|
||||
$fm->success('SUCCESS');
|
||||
}
|
||||
|
||||
sub create_modify_white
|
||||
{
|
||||
my $fm = shift;
|
||||
my $q = $fm->{'cgi'};
|
||||
|
||||
# qpsmtpd whitelisthosts
|
||||
my %list = $wdb->get('whitelisthosts')->props;
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelisthosts', "$parameter");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistHosts = $q->param("whitelisthosts");
|
||||
$WhitelistHosts =~ s/\r\n/,/g;
|
||||
my @WhitelistHosts = sort(split /,/, $WhitelistHosts);
|
||||
foreach $WhitelistHosts (@WhitelistHosts)
|
||||
{
|
||||
$wdb->set_prop('whitelisthosts', "$WhitelistHosts", 'White');
|
||||
}
|
||||
|
||||
# qpsmtpd whitelisthelo
|
||||
my %list_whitelisthelo = $wdb->get('whitelisthelo')->props;
|
||||
my $parameter_whitelisthelo = "";
|
||||
my $value_whitelisthelo = "";
|
||||
while (($parameter_whitelisthelo,$value_whitelisthelo) = each(%list_whitelisthelo)) {
|
||||
if ($parameter_whitelisthelo eq "type") {next;}
|
||||
|
||||
if ($value_whitelisthelo eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelisthelo', "$parameter_whitelisthelo");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistHelo = $q->param("whitelisthelo");
|
||||
$WhitelistHelo =~ s/\r\n/,/g;
|
||||
my @WhitelistHelo = sort(split /,/, $WhitelistHelo);
|
||||
foreach $WhitelistHelo (@WhitelistHelo)
|
||||
{
|
||||
$wdb->set_prop('whitelisthelo', "$WhitelistHelo", 'White');
|
||||
}
|
||||
|
||||
# qpsmtpd whitelistsenders
|
||||
my %list_whitelistsenders = $wdb->get('whitelistsenders')->props;
|
||||
my $parameter_whitelistsenders = "";
|
||||
my $value_whitelistsenders = "";
|
||||
while (($parameter_whitelistsenders,$value_whitelistsenders) = each(%list_whitelistsenders)) {
|
||||
if ($parameter_whitelistsenders eq "type") {next;}
|
||||
|
||||
if ($value_whitelistsenders eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelistsenders', "$parameter_whitelistsenders");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistSenders = $q->param("whitelistsenders");
|
||||
$WhitelistSenders =~ s/\r\n/,/g;
|
||||
my @WhitelistSenders = sort(split /,/, $WhitelistSenders);
|
||||
foreach $WhitelistSenders (@WhitelistSenders)
|
||||
{
|
||||
$wdb->set_prop('whitelistsenders', "$WhitelistSenders", 'White');
|
||||
}
|
||||
|
||||
# spamassassin whitelist_from
|
||||
my %list_wblglobal = $sdb->get('wbl.global')->props;
|
||||
my $parameter_wblglobal = "";
|
||||
my $value_wblglobal = "";
|
||||
while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
|
||||
if ($parameter_wblglobal eq "type") {next;}
|
||||
|
||||
if ($value_wblglobal eq "White") {
|
||||
$sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistFrom = $q->param("whitelistfrom");
|
||||
$WhitelistFrom =~ s/\r\n/,/g;
|
||||
my @WhitelistFrom = sort(split /,/, $WhitelistFrom);
|
||||
foreach $WhitelistFrom (@WhitelistFrom){
|
||||
$sdb->set_prop('wbl.global', "$WhitelistFrom", 'White');
|
||||
}
|
||||
|
||||
##Update email settings
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ){
|
||||
$fm->error('ERROR_UPDATING');
|
||||
return undef;
|
||||
}
|
||||
|
||||
$fm->success('SUCCESS');
|
||||
}
|
||||
|
||||
sub email_update
|
||||
{
|
||||
my $fm = shift;
|
||||
my $q = $fm->{'cgi'};
|
||||
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 )
|
||||
{
|
||||
$fm->error('ERROR_UPDATING');
|
||||
return undef;
|
||||
}
|
||||
|
||||
$fm->success('SUCCESS');
|
||||
|
||||
}
|
||||
|
||||
sub get_blacklistfrom
|
||||
{
|
||||
my %list = $sdb->get('wbl.global')->props;
|
||||
|
||||
my @blacklistfrom = ();
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "Black") {
|
||||
push @blacklistfrom, $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
return "" unless (scalar @blacklistfrom);
|
||||
|
||||
return join "\n", sort(@blacklistfrom);
|
||||
}
|
||||
sub create_modify_rbl
|
||||
{
|
||||
my $fm = shift;
|
||||
my $q = $fm->{'cgi'};
|
||||
|
||||
my $dnsbl = $q->param('dnsbl');
|
||||
$db->set_prop('qpsmtpd', 'DNSBL', "$dnsbl");
|
||||
|
||||
my $rhsbl = $q->param('rhsbl');
|
||||
$db->set_prop('qpsmtpd', 'RHSBL', "$rhsbl");
|
||||
|
||||
|
||||
my $sbllistcgi = $q->param('sbllist');
|
||||
my @sbllistcgi = split /\s{2,}/, $sbllistcgi;
|
||||
my $sbllistdb = '';
|
||||
foreach (@sbllistcgi) { $sbllistdb = $sbllistdb . ',' . $_; }
|
||||
$sbllistdb =~ s/^,//;
|
||||
|
||||
$db->set_prop('qpsmtpd', 'SBLList', "$sbllistdb");
|
||||
|
||||
|
||||
my $rbllistcgi = $q->param('rbllist');
|
||||
my @rbllistcgi = split /\s{2,}/, $rbllistcgi;
|
||||
my $rbllistdb = '';
|
||||
foreach (@rbllistcgi) { $rbllistdb = $rbllistdb . ',' . $_; }
|
||||
$rbllistdb =~ s/^,//;
|
||||
|
||||
$db->set_prop('qpsmtpd', 'RBLList', "$rbllistdb");
|
||||
|
||||
##Update email settings
|
||||
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ){
|
||||
$fm->error('ERROR_UPDATING');
|
||||
return undef;
|
||||
}
|
||||
|
||||
$fm->success('SUCCESS');
|
||||
}
|
||||
|
||||
#Subroutine to display buttons
|
||||
sub print_custom_button{
|
||||
my ($fm,$desc,$url) = @_;
|
||||
my $q = $fm->{cgi};
|
||||
$url="wbl?page=0&page_stack=&Next=Next&wherenext=".$url;
|
||||
print " <tr>\n <td colspan='2'>\n";
|
||||
print $q->p($q->a({href => $url, -class => "button-like"},$fm->localise($desc)));
|
||||
print qq(</tr>\n);
|
||||
return undef;
|
||||
}
|
||||
1;
|
553
root/usr/share/smanager/lib/SrvMngr/Controller/Wbl.pm
Normal file
553
root/usr/share/smanager/lib/SrvMngr/Controller/Wbl.pm
Normal file
@@ -0,0 +1,553 @@
|
||||
package SrvMngr::Controller::Wbl;
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# heading : System
|
||||
# description : E-mail WBL
|
||||
# navigation : 4000 550
|
||||
|
||||
# name : wbl, method : get, url : /wbl, ctlact : wbl#main
|
||||
# name : wbldis, method : post, url : /wbl, ctlact : wbl#do_display
|
||||
# name : wblupc, method : get, url : /wbl2, ctlact : wbl#do_update
|
||||
# name : wblupd, method : post, url : /wbl2, ctlact : wbl#do_update
|
||||
#
|
||||
# routes : end
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
|
||||
use Locale::gettext;
|
||||
use SrvMngr::I18N;
|
||||
|
||||
use SrvMngr qw( theme_list init_session );
|
||||
|
||||
use Exporter;
|
||||
our @EXPORT_OK = qw(
|
||||
get_contrib_desc
|
||||
get_contrib_routes
|
||||
);
|
||||
|
||||
our $db = esmith::ConfigDB->open() or die "Couldn't open ConfigDB\n";
|
||||
our $wdb = esmith::ConfigDB->open('wbl') or die "Couldn't open wbl dbase\n";
|
||||
our $sdb = esmith::ConfigDB->open('spamassassin') or die "Couldn't open spamassassin dbase\n";
|
||||
|
||||
|
||||
sub main {
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
|
||||
my %wbl_datas = ();
|
||||
my $title = $c->l('wbl_FORM_TITLE');
|
||||
|
||||
$wbl_datas{'trt'} = 'CHOICE';
|
||||
|
||||
$c->stash( title => $title, wbl_datas => \%wbl_datas);
|
||||
$c->render_maybe('wbl') or $c->render('wbl');
|
||||
};
|
||||
|
||||
|
||||
sub do_display {
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
|
||||
my $trt = $c->param('list') || 'CHOICE';
|
||||
|
||||
my %wbl_datas = ();
|
||||
my $title = $c->l('wbl_FORM_TITLE');
|
||||
|
||||
$wbl_datas{'trt'} = $trt;
|
||||
|
||||
if ( $trt eq 'RBL' ) {
|
||||
|
||||
# dnsbl - returns 'enabled/disabled
|
||||
$wbl_datas{'dnsbl'} = get_dnsbl();
|
||||
|
||||
# rhsbl - returns 'enabled/disabled
|
||||
$wbl_datas{'rhsbl'} = get_rhsbl();
|
||||
|
||||
# uribl - returns 'enabled/disabled
|
||||
$wbl_datas{'uribl'} = get_uribl();
|
||||
}
|
||||
|
||||
if ( $trt eq 'BLACK' ) {
|
||||
# For Black List
|
||||
}
|
||||
|
||||
if ( $trt eq 'WHITE' ) {
|
||||
# For WBL List
|
||||
}
|
||||
|
||||
if ( $trt eq 'CHOICE' ) {
|
||||
#
|
||||
}
|
||||
|
||||
$c->stash( title => $title, wbl_datas => \%wbl_datas );
|
||||
$c->render( template => 'wbl' );
|
||||
|
||||
};
|
||||
|
||||
|
||||
sub do_update {
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
|
||||
my %wbl_datas = ();
|
||||
my ($res, $result) = "";
|
||||
|
||||
my $title = $c->l('wbl_FORM_TITLE');
|
||||
|
||||
my $trt = ($c->param('trt') || '???');
|
||||
$wbl_datas{'trt'} = $trt;
|
||||
|
||||
#### $wbl_datas{'dnsbl'} = get_dnsbl(); etc...
|
||||
if ($trt eq 'RBL') {
|
||||
|
||||
# controls, validate
|
||||
#if (xxx) {
|
||||
# $result .= $c->l('XXXXXXX');
|
||||
#}
|
||||
|
||||
##$result .= ' ** Blocked for testing ** !';
|
||||
|
||||
if ( ! $result ) {
|
||||
$res = $c->create_modify_rbl();
|
||||
$result .= $res unless $res eq 'OK';
|
||||
if ( ! $result ) {
|
||||
$wbl_datas{trt} = 'SUC';
|
||||
$result = $c->l('SUCCESS').' RBL';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($trt eq 'BLACK') {
|
||||
|
||||
# controls, validate
|
||||
#if (xxx) {
|
||||
# $result .= $c->l('XXXXXXX');
|
||||
#}
|
||||
|
||||
##$result .= ' ** Blocked for testing ** !';
|
||||
|
||||
if ( ! $result ) {
|
||||
$res = $c->create_modify_black();
|
||||
$result .= $res unless $res eq 'OK';
|
||||
if ( ! $result ) {
|
||||
$wbl_datas{trt} = 'SUC';
|
||||
$result = $c->l('SUCCESS').' BLACK';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($trt eq 'WHITE') {
|
||||
|
||||
# controls, validate
|
||||
#if (xxx) {
|
||||
# $result .= $c->l('XXXXXXX');
|
||||
#}
|
||||
|
||||
##$result .= ' ** Blocked for testing ** !';
|
||||
|
||||
if ( ! $result ) {
|
||||
$res = $c->create_modify_white();
|
||||
$result .= $res unless $res eq 'OK';
|
||||
if ( ! $result ) {
|
||||
$wbl_datas{trt} = 'SUC';
|
||||
$result = $c->l('SUCCESS').' WHITE';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# common part
|
||||
$c->stash( title => $title, wbl_datas => \%wbl_datas );
|
||||
if ($wbl_datas{trt} ne 'SUC') {
|
||||
$c->flash(error => $result);
|
||||
$wbl_datas{'trt'} = $trt;
|
||||
return $c->render(template => 'wbl');
|
||||
}
|
||||
|
||||
# successfully terminated
|
||||
my $message = $trt . ' updates DONE';
|
||||
$c->app->log->info($message);
|
||||
$c->flash(success => $result);
|
||||
|
||||
#return to 'wbl' route !!!
|
||||
$c->redirect_to('wbl');
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub get_dnsbl {
|
||||
return ($db->get_prop('qpsmtpd', 'DNSBL') || 'disabled');
|
||||
}
|
||||
|
||||
|
||||
sub get_rhsbl {
|
||||
return ($db->get_prop('qpsmtpd', 'RHSBL') || 'disabled');
|
||||
}
|
||||
|
||||
|
||||
sub get_uribl {
|
||||
return ($db->get_prop('qpsmtpd', 'URIBL') || 'disabled');
|
||||
}
|
||||
|
||||
|
||||
sub get_sbllist {
|
||||
|
||||
my $sbllistform = $db->get_prop('qpsmtpd', 'SBLList') || '';
|
||||
my @list = (split /,/, $sbllistform);
|
||||
return \@list;
|
||||
}
|
||||
|
||||
|
||||
sub get_rbllist {
|
||||
|
||||
my $rbllistform = $db->get_prop('qpsmtpd', 'RBLList') || '';
|
||||
my @list = (split /,/, $rbllistform);
|
||||
return \@list;
|
||||
}
|
||||
|
||||
|
||||
sub get_ubllist {
|
||||
|
||||
my $ubllistform = $db->get_prop('qpsmtpd', 'UBLList') || '';
|
||||
my @list = ($ubllistform);
|
||||
return \@list;
|
||||
}
|
||||
|
||||
|
||||
sub get_wbllist {
|
||||
|
||||
my $c = shift;
|
||||
return [[$c->l('wbl_RBL_LIST') => 'RBL'],
|
||||
[$c->l('wbl_BLACK_LIST') => 'BLACK'],
|
||||
[$c->l('wbl_WHITE_LIST') => 'WHITE']];
|
||||
}
|
||||
|
||||
|
||||
sub get_badhelo {
|
||||
|
||||
my %list = $wdb->get('badhelo')->props;
|
||||
|
||||
my @badhelo = ();
|
||||
my ($parameter, $value) = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @badhelo, $parameter if ($value eq "Black");
|
||||
}
|
||||
my @badh = sort(@badhelo);
|
||||
return \@badh;
|
||||
}
|
||||
|
||||
|
||||
sub get_badmailfrom {
|
||||
|
||||
my %list = $wdb->get('badmailfrom')->props;
|
||||
|
||||
my @badmailfrom = ();
|
||||
my ($parameter, $value) = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @badmailfrom, $parameter if ($value eq "Black");
|
||||
}
|
||||
my @badmf = sort(@badmailfrom);
|
||||
return \@badmf;
|
||||
}
|
||||
|
||||
|
||||
sub get_blacklistfrom {
|
||||
|
||||
my %list = $sdb->get('wbl.global')->props;
|
||||
|
||||
my @blacklistfrom = ();
|
||||
my ($parameter, $value) = "";
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @blacklistfrom, $parameter if ($value eq "Black");
|
||||
}
|
||||
my @blacklf = sort(@blacklistfrom);
|
||||
return \@blacklf;
|
||||
}
|
||||
|
||||
|
||||
sub get_whitelisthosts {
|
||||
|
||||
my %list = $wdb->get('whitelisthosts')->props;
|
||||
|
||||
my @whitelisthosts = ();
|
||||
my ($parameter, $value) = "";
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @whitelisthosts, $parameter if ($value eq "White");
|
||||
}
|
||||
my @whitelh = sort(@whitelisthosts);
|
||||
return \@whitelh;
|
||||
}
|
||||
|
||||
|
||||
sub get_whitelisthelo {
|
||||
|
||||
my %list = $wdb->get('whitelisthelo')->props;
|
||||
|
||||
my @whitelisthelo = ();
|
||||
my ($parameter, $value) = "";
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @whitelisthelo, $parameter if ($value eq "White");
|
||||
}
|
||||
my @whitelh = sort(@whitelisthelo);
|
||||
return \@whitelh;
|
||||
}
|
||||
|
||||
|
||||
sub get_whitelistsenders {
|
||||
|
||||
my %list = $wdb->get('whitelistsenders')->props;
|
||||
|
||||
my @whitelistsenders = ();
|
||||
my ($parameter, $value) = "";
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @whitelistsenders, $parameter if ($value eq "White");
|
||||
}
|
||||
my @whitels = sort(@whitelistsenders);
|
||||
return \@whitels;
|
||||
}
|
||||
|
||||
|
||||
sub get_whitelistfrom {
|
||||
|
||||
my %list = $sdb->get('wbl.global')->props;
|
||||
|
||||
my @whitelistfrom = ();
|
||||
my ($parameter, $value) = "";
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
push @whitelistfrom, $parameter if ($value eq "White");
|
||||
}
|
||||
my @whitels = sort(@whitelistfrom);
|
||||
return \@whitels;
|
||||
}
|
||||
|
||||
|
||||
sub create_modify_rbl {
|
||||
|
||||
my $c = shift;
|
||||
|
||||
my $dnsbl = $c->param('Dnsbl');
|
||||
$db->set_prop('qpsmtpd', 'DNSBL', "$dnsbl");
|
||||
|
||||
my $rhsbl = $c->param('Rhsbl');
|
||||
$db->set_prop('qpsmtpd', 'RHSBL', "$rhsbl");
|
||||
|
||||
|
||||
my $sbllistcgi = $c->param('Sbllist');
|
||||
my @sbllistcgi = split /\s{2,}/, $sbllistcgi;
|
||||
my $sbllistdb = '';
|
||||
foreach (@sbllistcgi) { $sbllistdb = $sbllistdb . ',' . $_; }
|
||||
$sbllistdb =~ s/^,//;
|
||||
|
||||
$db->set_prop('qpsmtpd', 'SBLList', "$sbllistdb");
|
||||
|
||||
my $rbllistcgi = $c->param('Rbllist');
|
||||
my @rbllistcgi = split /\s{2,}/, $rbllistcgi;
|
||||
my $rbllistdb = '';
|
||||
foreach (@rbllistcgi) { $rbllistdb = $rbllistdb . ',' . $_; }
|
||||
$rbllistdb =~ s/^,//;
|
||||
|
||||
$db->set_prop('qpsmtpd', 'RBLList', "$rbllistdb");
|
||||
|
||||
#Update email settings
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ){
|
||||
return 'RBL : ' . $c->l('wbl_ERROR_UPDATING');
|
||||
}
|
||||
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
|
||||
sub create_modify_black {
|
||||
|
||||
my $c = shift;
|
||||
|
||||
#-------------------------------
|
||||
# qmail badhelo
|
||||
#-------------------------------
|
||||
my %list = $wdb->get('badhelo')->props;
|
||||
my ($parameter, $value) = '';
|
||||
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
next if ($parameter eq "type");
|
||||
if ($value eq "Black") {
|
||||
$wdb->get_prop_and_delete('badhelo', "$parameter");
|
||||
}
|
||||
}
|
||||
|
||||
my $BadHelo = $c->param("Badhelo");
|
||||
$BadHelo =~ s/\r\n/,/g;
|
||||
my @BadHelo = sort(split /,/, $BadHelo);
|
||||
foreach $BadHelo (@BadHelo) {
|
||||
$wdb->set_prop('badhelo', "$BadHelo", 'Black');
|
||||
}
|
||||
|
||||
#-------------------------------
|
||||
# qmail badmailfrom
|
||||
#-------------------------------
|
||||
my %list_badmailfrom = $wdb->get('badmailfrom')->props;
|
||||
my ($parameter_badmailfrom, $value_badmailfrom) = "";
|
||||
|
||||
while (($parameter_badmailfrom,$value_badmailfrom) = each(%list_badmailfrom)) {
|
||||
next if ($parameter_badmailfrom eq "type");
|
||||
if ($value_badmailfrom eq "Black") {
|
||||
$wdb->get_prop_and_delete('badmailfrom', "$parameter_badmailfrom");
|
||||
}
|
||||
}
|
||||
|
||||
my $BadMailFrom = $c->param("Badmailfrom");
|
||||
$BadMailFrom =~ s/\r\n/,/g;
|
||||
my @BadMailFrom = sort(split /,/, $BadMailFrom);
|
||||
foreach $BadMailFrom (@BadMailFrom){
|
||||
$wdb->set_prop('badmailfrom', "$BadMailFrom", 'Black');
|
||||
}
|
||||
#-------------------------------
|
||||
# spamassassin blacklist_from
|
||||
#-------------------------------
|
||||
my %list_wblglobal = $sdb->get('wbl.global')->props;
|
||||
my ($parameter_wblglobal, $value_wblglobal) = "";
|
||||
|
||||
while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
|
||||
next if ($parameter_wblglobal eq "type");
|
||||
if ($value_wblglobal eq "Black") {
|
||||
$sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
|
||||
}
|
||||
}
|
||||
|
||||
my $BlacklistFrom = $c->param("Blacklistfrom");
|
||||
$BlacklistFrom =~ s/\r\n/,/g;
|
||||
my @BlacklistFrom = sort(split /,/, $BlacklistFrom);
|
||||
foreach $BlacklistFrom (@BlacklistFrom){
|
||||
$sdb->set_prop('wbl.global', "$BlacklistFrom", 'Black');
|
||||
}
|
||||
|
||||
#Update email settings
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ) {
|
||||
return 'BLACK: '. $c->l('wbl_ERROR_UPDATING');
|
||||
}
|
||||
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
|
||||
sub create_modify_white {
|
||||
|
||||
my $c = shift;
|
||||
|
||||
#-------------------------------
|
||||
# qpsmtpd whitelisthosts
|
||||
#-------------------------------
|
||||
my %list = $wdb->get('whitelisthosts')->props;
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%list)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelisthosts', "$parameter");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistHosts = $c->param("Whitelisthosts");
|
||||
$WhitelistHosts =~ s/\r\n/,/g;
|
||||
my @WhitelistHosts = sort(split /,/, $WhitelistHosts);
|
||||
foreach $WhitelistHosts (@WhitelistHosts)
|
||||
{
|
||||
$wdb->set_prop('whitelisthosts', "$WhitelistHosts", 'White');
|
||||
}
|
||||
|
||||
#-------------------------------
|
||||
# qpsmtpd whitelisthelo
|
||||
#-------------------------------
|
||||
my %list_whitelisthelo = $wdb->get('whitelisthelo')->props;
|
||||
my $parameter_whitelisthelo = "";
|
||||
my $value_whitelisthelo = "";
|
||||
while (($parameter_whitelisthelo,$value_whitelisthelo) = each(%list_whitelisthelo)) {
|
||||
if ($parameter_whitelisthelo eq "type") {next;}
|
||||
|
||||
if ($value_whitelisthelo eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelisthelo', "$parameter_whitelisthelo");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistHelo = $c->param("Whitelisthelo");
|
||||
$WhitelistHelo =~ s/\r\n/,/g;
|
||||
my @WhitelistHelo = sort(split /,/, $WhitelistHelo);
|
||||
foreach $WhitelistHelo (@WhitelistHelo)
|
||||
{
|
||||
$wdb->set_prop('whitelisthelo', "$WhitelistHelo", 'White');
|
||||
}
|
||||
|
||||
#-------------------------------
|
||||
# qpsmtpd whitelistsenders
|
||||
#-------------------------------
|
||||
my %list_whitelistsenders = $wdb->get('whitelistsenders')->props;
|
||||
my $parameter_whitelistsenders = "";
|
||||
my $value_whitelistsenders = "";
|
||||
while (($parameter_whitelistsenders,$value_whitelistsenders) = each(%list_whitelistsenders)) {
|
||||
if ($parameter_whitelistsenders eq "type") {next;}
|
||||
|
||||
if ($value_whitelistsenders eq "White") {
|
||||
$wdb->get_prop_and_delete('whitelistsenders', "$parameter_whitelistsenders");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistSenders = $c->param("Whitelistsenders");
|
||||
$WhitelistSenders =~ s/\r\n/,/g;
|
||||
my @WhitelistSenders = sort(split /,/, $WhitelistSenders);
|
||||
foreach $WhitelistSenders (@WhitelistSenders)
|
||||
{
|
||||
$wdb->set_prop('whitelistsenders', "$WhitelistSenders", 'White');
|
||||
}
|
||||
|
||||
#-------------------------------
|
||||
# spamassassin whitelist_from
|
||||
#-------------------------------
|
||||
my %list_wblglobal = $sdb->get('wbl.global')->props;
|
||||
my $parameter_wblglobal = "";
|
||||
my $value_wblglobal = "";
|
||||
while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
|
||||
if ($parameter_wblglobal eq "type") {next;}
|
||||
|
||||
if ($value_wblglobal eq "White") {
|
||||
$sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
|
||||
}
|
||||
}
|
||||
|
||||
my $WhitelistFrom = $c->param("Whitelistfrom");
|
||||
$WhitelistFrom =~ s/\r\n/,/g;
|
||||
my @WhitelistFrom = sort(split /,/, $WhitelistFrom);
|
||||
foreach $WhitelistFrom (@WhitelistFrom){
|
||||
$sdb->set_prop('wbl.global', "$WhitelistFrom", 'White');
|
||||
}
|
||||
|
||||
#Update email settings
|
||||
unless ( system ("/sbin/e-smith/signal-event", "wbl-update") == 0 ) {
|
||||
return 'WHITE: '. $c->l('wbl_ERROR_UPDATING');
|
||||
}
|
||||
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
@@ -0,0 +1,42 @@
|
||||
'wbl_SAVE' => 'Save',
|
||||
'wbl_PERFORM' => 'Perform',
|
||||
'wbl_FORM_TITLE' => 'E-mail WBL',
|
||||
'wbl_OPERATION_STATUS_REPORT' => 'Operation status report',
|
||||
'wbl_WBL_DESCRIPTION' => 'E-mail traffic is scanned and may be blocked due to the various screening methods enabled.
|
||||
You may use this panel to define e-mail white/black lists.',
|
||||
'wbl_RBL_LIST_DESCRIPTION' => 'RBL\'s List is used to adjust DNSBL and RHSBL.',
|
||||
'wbl_RBL_LIST' => 'RBL\'s List',
|
||||
'wbl_BLACK_LIST_DESCRIPTION' => 'Black lists are used for rejecting e-mail traffic.',
|
||||
'wbl_BLACK_LIST' => 'Black List',
|
||||
'wbl_WHITE_LIST_DESCRIPTION' => 'White lists are used for accepting e-mail traffic.',
|
||||
'wbl_WHITE_LIST' => 'White List',
|
||||
'wbl_BLACK_TITLE' => 'This server includes built-in support for using the admin defined black lists, badhelo and
|
||||
badmailfrom.',
|
||||
'wbl_DNSBL_DESCRIPTION' => 'DNSBL is an abbreviation for "DNS blacklist".',
|
||||
'wbl_DNSBL_LABEL' => 'DNSBL status',
|
||||
'wbl_RHSBL_DESCRIPTION' => 'RHSBL is an abbreviation for "Right Hand Side Blacklist". ',
|
||||
'wbl_RHSBL_LABEL' => 'RHSBL status',
|
||||
'wbl_BADHELO_DESCRIPTION' => 'Check a HELO message delivered from a connecting host.Reject any
|
||||
that appear in badhelo during the \'helo\' stage.',
|
||||
'wbl_BADHELO_LABEL' => 'qpsmtpd badhelo',
|
||||
'wbl_BADMAILFROM_DESCRIPTION' => 'Check envelope sender addresses. Reject any
|
||||
that appear (@host or user@host) in badmailfrom during the \'mail\' stage.',
|
||||
'wbl_BADMAILFROM_LABEL' => 'qmail badmailfrom',
|
||||
'wbl_WHITE_TITLE' => 'Use this panel to modify your servers White List settings. All entries will be enabled by default',
|
||||
'wbl_RRFH_LABEL' => 'Whitelists status',
|
||||
'wbl_WHITELISTHOSTS_DESCRIPTION' => 'Any IP address listed in whitelisthosts will be exempted
|
||||
from any further validation during the \'connect\' stage.',
|
||||
'wbl_WHITELISTHOSTS_LABEL' => 'qpsmtpd whitelisthosts',
|
||||
'wbl_WHITELISTHELO_DESCRIPTION' => 'be exempted from further validation during the \'helo\' stage.',
|
||||
'wbl_WHITELISTHELO_LABEL' => 'qpsmtpd whitelisthelo',
|
||||
'wbl_WHITELISTSENDERS_DESCRIPTION' => 'will be exempted from further validation during the \'mail\' stage.',
|
||||
'wbl_WHITELISTSENDERS_LABEL' => 'qpsmtpd whitelistsenders',
|
||||
'wbl_WHITELISTFROM_DESCRIPTION' => 'will be exempted from spamassassin rejection.',
|
||||
'wbl_WHITELISTFROM_LABEL' => 'spamassassin whitelist_from',
|
||||
'wbl_BLACKLISTFROM_LABEL' => 'spamassassin blacklist_from',
|
||||
'wbl_BLACKLISTFROM_DESCRIPTION' => 'will be rejected by spamassassin.',
|
||||
'wbl_SBLLIST_LABEL' => 'RHSBL (qpsmtpd SBLList)',
|
||||
'wbl_SBLLIST_DESCRIPTION' => 'RHS block list - \'right hand side\' of senders host/domain will be checked against the following servers',
|
||||
'wbl_RBLLIST_LABEL' => 'DNSBL Zones (qpsmtpd RBLList)',
|
||||
'wbl_RBLLIST_DESCRIPTION' => 'DNS Block List - senders IP address will be checked against the following servers',
|
||||
'wbl_RBL_TITLE' => 'Real-time Blackhole Lists are disabled by default. To help reduce spam you can enable RBLs here.',
|
@@ -0,0 +1,37 @@
|
||||
'wbl_SAVE' => 'Sauvegarder',
|
||||
'wbl_PERFORM' => 'Exécuter',
|
||||
'wbl_FORM_TITLE' => 'WBL courriel',
|
||||
'wbl_OPERATION_STATUS_REPORT' => 'Rapport d\'état de l\'opération',
|
||||
'wbl_WBL_DESCRIPTION' => 'Le trafic courriel est scanné et peut être bloqué en raison des différentes méthodes de dépistage activées. Vous pouvez utiliser ce panneau pour définir les listes blanches / noires de courriels.',
|
||||
'wbl_RBL_LIST_DESCRIPTION' => 'La liste RBL est utilisée pour ajuster DNSBL et RHSBL.',
|
||||
'wbl_RBL_LIST' => 'Liste RBL',
|
||||
'wbl_BLACK_LIST_DESCRIPTION' => 'Les listes noires sont utilisées pour refuser le trafic de courriels.',
|
||||
'wbl_BLACK_LIST' => 'Liste noire',
|
||||
'wbl_WHITE_LIST_DESCRIPTION' => 'Les listes blanches sont utilisées pour accepter le trafic de courriels.',
|
||||
'wbl_WHITE_LIST' => 'Liste blanche',
|
||||
'wbl_BLACK_TITLE' => 'Ce serveur inclus un support intégré permettant à l\'administrateur de définir des listes noires, badhelo et badmailfrom.',
|
||||
'wbl_DNSBL_DESCRIPTION' => 'DNSBL est une abréviation Anglaise pour "Liste noire DNS".',
|
||||
'wbl_DNSBL_LABEL' => 'Statut DNSBL',
|
||||
'wbl_RHSBL_DESCRIPTION' => 'RHSBL est une abréviation pour "Right Hand Side Blacklist".',
|
||||
'wbl_RHSBL_LABEL' => 'Rapport d\'état de RHSBL',
|
||||
'wbl_BADHELO_DESCRIPTION' => 'Vérifie un message HELO livré par un hôte se connectant. Ceci refuse tout ceux qui apparaissent dans badhelo au moment de la phase \'helo\'.',
|
||||
'wbl_BADHELO_LABEL' => 'qpsmtpd badhelo',
|
||||
'wbl_BADMAILFROM_DESCRIPTION' => 'Vérifie l\'adresse de l\'expéditeur. Refuse tout ce qui apparaît (@hôte ou utilisateur@hôte) dans\'badmailfrom\' pendant la phase \'mail\'',
|
||||
'wbl_BADMAILFROM_LABEL' => 'qmail \'badmailfrom\'',
|
||||
'wbl_WHITE_TITLE' => 'Utilisez cette page pour modifier les paramètres de liste blanche de de votre serveur. Toutes les entrées seront activées par default',
|
||||
'wbl_RRFH_LABEL' => 'État des listes blanches',
|
||||
'wbl_WHITELISTHOSTS_DESCRIPTION' => 'Toute IP présente dans whitelisthosts sera exemptée de toutes validations supplémentaires pendant la phase \'connexion\'',
|
||||
'wbl_WHITELISTHOSTS_LABEL' => 'Qpsmtpd whitelisthosts',
|
||||
'wbl_WHITELISTHELO_DESCRIPTION' => 'Tout hôte qui émet un HELO correspondant à une entrée dans whitelisthelo sera exempté de toute autre validation pendant la phase \'helo\'',
|
||||
'wbl_WHITELISTHELO_LABEL' => 'qpsmtpd whitelisthelo',
|
||||
'wbl_WHITELISTSENDERS_DESCRIPTION' => 'Tout expéditeur d\'un courriel (hôte.domaine ou utilisateur@hôte.domaine) correspondant à une entrée dans la liste blanche des expéditeurs (whitelistsenders) sera exempté de toutes validations supplémentaires durant la phase \'mail\'.',
|
||||
'wbl_WHITELISTSENDERS_LABEL' => 'qpsmtpd whitelistsenders',
|
||||
'wbl_WHITELISTFROM_DESCRIPTION' => 'Tout expéditeur d\'un courriel (*@hôte ou utilisateur@hôte) correspondant à une entrée dans whitelist_from sera exempté d\'un rejet par spamassassin.',
|
||||
'wbl_WHITELISTFROM_LABEL' => 'spamassassin whitelist_from',
|
||||
'wbl_BLACKLISTFROM_LABEL' => 'spamassassin blacklist_from',
|
||||
'wbl_BLACKLISTFROM_DESCRIPTION' => 'Tout expéditeur d\'un courriel (*@hôte ou utilisateur@hôte) correspondant à une entrée dans blacklist_from sera rejeté par spamassassin.',
|
||||
'wbl_SBLLIST_LABEL' => 'RHSBL (qpsmtpd SBLList)',
|
||||
'wbl_SBLLIST_DESCRIPTION' => 'Liste de blocage RHS - (Right Hand Side) des expéditeurs hôte / domaine sera vérifié contre les serveurs suivants',
|
||||
'wbl_RBLLIST_LABEL' => 'DNSBL Zones (qpsmtpd RBLList)',
|
||||
'wbl_RBLLIST_DESCRIPTION' => 'Liste de bloquage DNS -L\'adresse IP des expéditeurs sera vérifiée à partir des serveurs suivants.',
|
||||
'wbl_RBL_TITLE' => 'Les listes noires en temps réel sont désactivés par défaut. Pour aider à réduire le spam vous pouvez activer les RBLs ici.',
|
@@ -0,0 +1,50 @@
|
||||
<div>
|
||||
% my $btn = l 'SAVE';
|
||||
%= form_for '/wbl2' => (method => 'POST') => begin
|
||||
|
||||
%= hidden_field 'trt' => $wbl_datas->{trt}
|
||||
|
||||
<h3>
|
||||
%=l 'wbl_BLACK_LIST_DESCRIPTION'
|
||||
</h3>
|
||||
%=l 'wbl_BLACK_TITLE'
|
||||
|
||||
<p>
|
||||
%=l 'wbl_BADHELO_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_BADHELO_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Badhelo' => (cols => 40) => begin
|
||||
% for (@{ $c->get_badhelo() }) {
|
||||
%= $_
|
||||
%}
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_BADMAILFROM_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_BADMAILFROM_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Badmailfrom' => (cols => 40) => begin
|
||||
% for (@{ $c->get_badmailfrom() }) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_BLACKLISTFROM_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_BLACKLISTFROM_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Blacklistfrom' => (cols => 40) => begin
|
||||
% for (@{ $c->get_blacklistfrom() }) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
%= submit_button "$btn", class => 'action'
|
||||
%end
|
||||
</div>
|
@@ -0,0 +1,24 @@
|
||||
<div id='wbl_choice'>
|
||||
|
||||
% my $btn = l 'NEXT';
|
||||
%= form_for '/wbl' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'wbl_RBL_LIST_DESCRIPTION'
|
||||
</span><br>
|
||||
|
||||
<span class=label>
|
||||
%=l 'wbl_BLACK_LIST_DESCRIPTION'
|
||||
</span><span class=data>
|
||||
% param 'list' => $wbl_datas->{list} unless param 'list';
|
||||
%= select_field 'list' => $c->get_wbllist(), class => 'input'
|
||||
</span><br>
|
||||
|
||||
<span class=label>
|
||||
%=l 'wbl_WHITE_LIST_DESCRIPTION'
|
||||
</span></p>
|
||||
|
||||
<p><br>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</p>
|
||||
%end
|
||||
</div>
|
@@ -0,0 +1,62 @@
|
||||
<div>
|
||||
|
||||
% my $btn = l 'SAVE';
|
||||
%= form_for '/wbl2' => (method => 'POST') => begin
|
||||
|
||||
%= hidden_field 'trt' => $wbl_datas->{trt}
|
||||
|
||||
<!-- # For URLList List
|
||||
# my @ubllist = get_ubllist();
|
||||
# $c->stash( ubllist => \@ubllist ); -->
|
||||
|
||||
<h3>
|
||||
%=l 'wbl_RBL_LIST_DESCRIPTION'
|
||||
</h3><br>
|
||||
%=l 'wbl_RBL_TITLE'
|
||||
|
||||
<p>
|
||||
%=l 'wbl_DNSBL_DESCRIPTION'
|
||||
<br><span class=label>
|
||||
%=l 'wbl_DNSBL_LABEL'
|
||||
</span><span class=data2>
|
||||
% param 'Dnsbl' => $wbl_datas->{dnsbl} unless param 'Dnsbl';
|
||||
%= select_field 'Dnsbl' => [[(l 'ENABLED') => 'enabled'], [(l 'DISABLED') => 'disabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_RBLLIST_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_RBLLIST_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Rbllist' => (cols => 40) => begin
|
||||
% for ( @{$c->get_rbllist()} ) {
|
||||
%= $_
|
||||
%}
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_RHSBL_DESCRIPTION'
|
||||
<br><span class=label>
|
||||
%=l 'wbl_RHSBL_LABEL'
|
||||
</span><span class=data2>
|
||||
% param 'Rhsbl' => $wbl_datas->{rhsbl} unless param 'Rhsbl';
|
||||
%= select_field 'Rhsbl' => [[(l 'ENABLED') => 'enabled'], [(l 'DISABLED') => 'disabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_SBLLIST_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_SBLLIST_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Sbllist' => (cols => 40) => begin
|
||||
% for ( @{$c->get_sbllist()} ) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
%= submit_button "$btn", class => 'action'
|
||||
%end
|
||||
|
||||
</div>
|
@@ -0,0 +1,65 @@
|
||||
<div>
|
||||
% my $btn = l 'SAVE';
|
||||
%= form_for '/wbl2' => (method => 'POST') => begin
|
||||
|
||||
%= hidden_field 'trt' => $wbl_datas->{trt}
|
||||
|
||||
<h3>
|
||||
%=l 'wbl_WHITE_LIST_DESCRIPTION'
|
||||
</h3>
|
||||
%=l 'wbl_WHITE_TITLE'
|
||||
|
||||
<p>
|
||||
%=l 'wbl_WHITELISTHOSTS_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_WHITELISTHOSTS_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Whitelisthosts' => (cols => 40) => begin
|
||||
% for (@{ $c->get_whitelisthosts() }) {
|
||||
%= $_
|
||||
%}
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_WHITELISTHELO_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_WHITELISTHELO_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Whitelisthelo' => (cols => 40) => begin
|
||||
% for (@{ $c->get_whitelisthelo() }) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span></p><br>
|
||||
|
||||
<p>
|
||||
%=l 'wbl_WHITELISTSENDERS_DESCRIPTION'
|
||||
<br><br><span class=label>
|
||||
%=l 'wbl_WHITELISTSENDERS_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Whitelistsenders' => (cols => 40) => begin
|
||||
% for (@{ $c->get_whitelistsenders() }) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span>
|
||||
</p>
|
||||
<br>
|
||||
<p>
|
||||
%=l 'wbl_WHITELISTFROM_DESCRIPTION'
|
||||
<br><br>
|
||||
<span class=label>
|
||||
%=l 'wbl_WHITELISTFROM_LABEL'
|
||||
</span><span class=data2>
|
||||
%= text_area 'Whitelistfrom' => (cols => 40) => begin
|
||||
% for (@{ $c->get_whitelistfrom() }) {
|
||||
%= $_
|
||||
% }
|
||||
%end
|
||||
</span>
|
||||
</p>
|
||||
<br>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
%end
|
||||
</div>
|
33
root/usr/share/smanager/themes/default/templates/wbl.html.ep
Normal file
33
root/usr/share/smanager/themes/default/templates/wbl.html.ep
Normal file
@@ -0,0 +1,33 @@
|
||||
% layout 'default', title => "Sme server 2 - wbl", share_dir => '';
|
||||
|
||||
% content_for 'module' => begin
|
||||
|
||||
|
||||
<div id="module" class="module wbl-panel">
|
||||
|
||||
%if ($config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $wbl_datas
|
||||
</p>
|
||||
%}
|
||||
|
||||
<h1><%= $title %></h1>
|
||||
|
||||
<br>
|
||||
%= l('wbl_WBL_DESCRIPTION')
|
||||
<br>
|
||||
|
||||
% if ($wbl_datas->{trt} eq 'RBL') {
|
||||
%= include 'partials/_wbl_rbl'
|
||||
%} elsif ($wbl_datas->{trt} eq 'BLACK') {
|
||||
%= include 'partials/_wbl_black'
|
||||
%} elsif ($wbl_datas->{trt} eq 'WHITE') {
|
||||
%= include 'partials/_wbl_white'
|
||||
%} else {
|
||||
%= include 'partials/_wbl_choice'
|
||||
%}
|
||||
|
||||
</div>
|
||||
%end
|
||||
|
Reference in New Issue
Block a user