* Tue Sep 24 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-22.sme

- fix typos, and tidy tabs [SME: 12744]
This commit is contained in:
Jean-Philippe Pialasse 2024-09-24 22:06:09 -04:00
parent 44a9ecc0e1
commit 4d2097d2da
2 changed files with 111 additions and 95 deletions

View File

@ -57,12 +57,14 @@ sub do_display {
$mai_datas{'trt'} = $trt; $mai_datas{'trt'} = $trt;
if ( $trt eq 'ACC' ) { if ( $trt eq 'ACC' )
$dest = 'emailaccess'; {
$mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method'); $dest = 'emailaccess';
} $mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method');
}
if ( $trt eq 'FIL' ) { if ( $trt eq 'FIL' )
{
$dest = 'emailfilter'; $dest = 'emailfilter';
$mai_datas{'virusstatus'} = $c->get_virus_status(); $mai_datas{'virusstatus'} = $c->get_virus_status();
$mai_datas{'spamstatus'} = $cdb->get_prop('spamassassin', 'status'); $mai_datas{'spamstatus'} = $cdb->get_prop('spamassassin', 'status');
@ -72,9 +74,10 @@ sub do_display {
$mai_datas{spamsortspam} = $cdb->get_prop('spamassassin', 'SortSpam'); $mai_datas{spamsortspam} = $cdb->get_prop('spamassassin', 'SortSpam');
$mai_datas{spamsubjecttag} = $cdb->get_prop('spamassassin', 'SubjectTag'); $mai_datas{spamsubjecttag} = $cdb->get_prop('spamassassin', 'SubjectTag');
$mai_datas{spamsubject} = $cdb->get_prop('spamassassin', 'Subject'); $mai_datas{spamsubject} = $cdb->get_prop('spamassassin', 'Subject');
} }
if ( $trt eq 'REC' ) { if ( $trt eq 'REC' )
{
$dest = 'emailreceive'; $dest = 'emailreceive';
$mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method'); $mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method');
$mai_datas{freqoffice} = $cdb->get_prop('fetchmail', 'FreqOffice'); $mai_datas{freqoffice} = $cdb->get_prop('fetchmail', 'FreqOffice');
@ -86,9 +89,10 @@ sub do_display {
$mai_datas{specifyheader} = get_secondary_mail_use_envelope(); $mai_datas{specifyheader} = get_secondary_mail_use_envelope();
$mai_datas{secondarymailenvelope} = $cdb->get_prop('fetchmail', 'SecondaryMailEnvelope'); $mai_datas{secondarymailenvelope} = $cdb->get_prop('fetchmail', 'SecondaryMailEnvelope');
} }
if ( $trt eq 'DEL' ) { if ( $trt eq 'DEL' )
{
$dest = 'emaildeliver'; $dest = 'emaildeliver';
$mai_datas{emailunknownuser} = $cdb->get_value('EmailUnknownUser') || '"returntosender'; $mai_datas{emailunknownuser} = $cdb->get_value('EmailUnknownUser') || '"returntosender';
$mai_datas{delegatemailserver} = $cdb->get_value('DelegateMailServer'); $mai_datas{delegatemailserver} = $cdb->get_value('DelegateMailServer');
@ -96,7 +100,7 @@ sub do_display {
$mai_datas{smtpauthproxystatus} = $cdb->get_prop('smtp-auth-proxy', 'status') || 'disabled'; $mai_datas{smtpauthproxystatus} = $cdb->get_prop('smtp-auth-proxy', 'status') || 'disabled';
$mai_datas{smtpauthproxyuserid} = $cdb->get_prop('smtp-auth-proxy', 'Userid') || ''; $mai_datas{smtpauthproxyuserid} = $cdb->get_prop('smtp-auth-proxy', 'Userid') || '';
$mai_datas{smtpauthproxypassword} = $cdb->get_prop('smtp-auth-proxy', 'Passwd') || ''; $mai_datas{smtpauthproxypassword} = $cdb->get_prop('smtp-auth-proxy', 'Passwd') || '';
} }
$c->stash( title => $title, notif => $notif, mai_datas => \%mai_datas ); $c->stash( title => $title, notif => $notif, mai_datas => \%mai_datas );
@ -120,98 +124,107 @@ sub do_update {
my ($dest, $res, $result) = ''; my ($dest, $res, $result) = '';
if ( $trt eq 'ACC' ) { if ( $trt eq 'ACC' )
{
$dest = 'emailaccess';
# $mai_datas{xxx} = $c->param('XXX');
# controls
# $res = xxxxxxx( $c );
# $result .= $res unless $res eq 'OK';
$dest = 'emailaccess'; if ( ! $result )
# $mai_datas{xxx} = $c->param('XXX'); {
$res = $c->change_settings_access();
$result .= $res unless $res eq 'OK';
if ( ! $result )
{
$result = $c->l('mai_SUCCESS');
}
}
}
# controls if ( $trt eq 'FIL' )
# $res = xxxxxxx( $c ); {
# $result .= $res unless $res eq 'OK'; $dest = 'emailfilter';
# $mai_datas{xxx} = $c->param('XXX');
# controls
# $res = zzzzzz( $c );
# $result .= $res unless $res eq 'OK';
if ( ! $result ) { if ( ! $result )
$res = $c->change_settings_access(); {
$result .= $res unless $res eq 'OK'; $res = $c->change_settings_filtering();
if ( ! $result ) { $result .= $res unless $res eq 'OK';
$result = $c->l('mai_SUCCESS'); if ( ! $result )
} {
} $result = $c->l('mai_SUCCESS');
} }
}
}
if ( $trt eq 'FIL' ) { if ( $trt eq 'REC' )
{
$dest = 'emailreceive';
# $mai_datas{xxx} = $c->param('XXX');
# controls
# $res = yyyyyyyyy( $c );
# $result .= $res unless $res eq 'OK';
$dest = 'emailfilter'; if ( ! $result )
# $mai_datas{xxx} = $c->param('XXX'); {
$res = $c->change_settings_reception();
$result .= $res unless $res eq 'OK';
if ( ! $result )
{
$result = $c->l('mai_SUCCESS');
}
}
}
# controls if ( $trt eq 'DEL' )
# $res = zzzzzz( $c ); {
# $result .= $res unless $res eq 'OK'; $dest = 'emaildeliver';
# $mai_datas{xxx} = $c->param('XXX');
# controls
$res = $c->ip_number_or_blank( $c->param('DelegateMailServer') );
$result .= $res . ' DMS <br>' unless $res eq 'OK';
if ( ! $result ) { $res = $c->validate_smarthost( $c->param('SMTPSmartHost') );
$res = $c->change_settings_filtering(); $result .= $res . ' SH <br>' unless $res eq 'OK';
$result .= $res unless $res eq 'OK';
if ( ! $result ) {
$result = $c->l('mai_SUCCESS');
}
}
}
if ( $trt eq 'REC' ) { $res = $c->nonblank_if_smtpauth( $c->param('SMTPSmartHost') );
$result .= $res . ' SH <br>' unless $res eq 'OK';
$dest = 'emailreceive'; $res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Userid') );
# $mai_datas{xxx} = $c->param('XXX'); $result .= $res . ' USR <br>' unless $res eq 'OK';
# controls $res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Passwd') );
# $res = yyyyyyyyy( $c ); $result .= $res . ' PWD <br>' unless $res eq 'OK';
# $result .= $res unless $res eq 'OK';
if ( ! $result ) { if ( ! $result )
$res = $c->change_settings_reception(); {
$result .= $res unless $res eq 'OK'; $res = $c->change_settings_delivery();
if ( ! $result ) { $result .= $res unless $res eq 'OK';
$result = $c->l('mai_SUCCESS'); if ( ! $result )
} {
} $result = $c->l('mai_SUCCESS');
} }
}
if ( $trt eq 'DEL' ) { }
$dest = 'emaildeliver';
# $mai_datas{xxx} = $c->param('XXX');
# controls
$res = $c->ip_number_or_blank( $c->param('DelegateMailServer') );
$result .= $res . ' DMS <br>' unless $res eq 'OK';
$res = $c->validate_smarthost( $c->param('SMTPSmartHost') );
$result .= $res . ' SH <br>' unless $res eq 'OK';
$res = $c->nonblank_if_smtpauth( $c->param('SMTPSmartHost') );
$result .= $res . ' SH <br>' unless $res eq 'OK';
$res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Userid') );
$result .= $res . ' USR <br>' unless $res eq 'OK';
$res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Passwd') );
$result .= $res . ' PWD <br>' unless $res eq 'OK';
if ( ! $result ) {
$res = $c->change_settings_delivery();
$result .= $res unless $res eq 'OK';
if ( ! $result ) {
$result = $c->l('mai_SUCCESS');
}
}
}
# common part # common part
if ($res ne 'OK') { if ($res ne 'OK')
$c->stash( error => $result ); {
$c->stash( title => $title, mai_datas => \%mai_datas ); $c->stash( error => $result );
return $c->render( $dest ); $c->stash( title => $title, mai_datas => \%mai_datas );
} return $c->render( $dest );
}
my $message = "emailsettings updates $trt DONE"; my $message = "emailsettings updates $trt DONE";
$c->app->log->info($message); $c->app->log->info($message);
@ -399,7 +412,7 @@ sub get_current_webmail_status {
my $MysqlStatus = $cdb->get_prop('mariadb', 'status') || 'disabled'; my $MysqlStatus = $cdb->get_prop('mariadb', 'status') || 'disabled';
my $PHPStatus = $cdb->get_prop('php81', 'status') || 'disabled'; my $PHPStatus = $cdb->get_prop('php81-php-fpm', 'status') || 'disabled';
my $Networkaccess = $cdb->get_prop('roundcube','access') || 'disabled'; my $Networkaccess = $cdb->get_prop('roundcube','access') || 'disabled';
@ -515,7 +528,7 @@ sub get_webmail_options {
my %options = ( my %options = (
disabled => 'DISABLED', disabled => 'DISABLED',
enabledSSL => 'mai_ENABLED_SECURE_ONLY', enabledSSL => 'mai_ENABLED_SECURE_ONLY',
localnetworkSSL => 'mai_ONLY_LOCAL_NETWORK_SSL') localnetworkSSL => 'mai_ONLY_LOCAL_NETWORK_SSL');
return \%options; return \%options;
} }
@ -749,7 +762,7 @@ sub change_settings_delivery {
sub change_settings_access { sub change_settings_access {
my $c = shift; my $c = shift;
$cdb = esmith::ConfigDB->open || die "Couldn't open config db"; $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
my $pop3Access = ($c->param('POPAccess') || 'private'); my $pop3Access = ($c->param('POPAccess') || 'private');
if ($pop3Access eq 'disabled') { if ($pop3Access eq 'disabled') {
@ -801,14 +814,14 @@ sub change_settings_access {
my $webmail = ($c->param('WebMail') || 'disabled'); my $webmail = ($c->param('WebMail') || 'disabled');
if ( $webmail eq "enabledSSL" ) { if ( $webmail eq "enabledSSL" ) {
$cdb->set_prop('php81',"status", "enabled" ); $cdb->set_prop('php81-php-fpm',"status", "enabled" );
$cdb->set_prop('mariadb',"status", "enabled" ); $cdb->set_prop('mariadb',"status", "enabled" );
$cdb->set_prop('roundcube',"status", 'enabled' ); $cdb->set_prop('roundcube',"status", 'enabled' );
$cdb->set_prop('roundcube',"access", "public" ); $cdb->set_prop('roundcube',"access", "public" );
} }
elsif ( $webmail eq "localnetworkSSL" ) { elsif ( $webmail eq "localnetworkSSL" ) {
$cdb->set_prop('php81',"status", "enabled" ); $cdb->set_prop('php81-php-fpm',"status", "enabled" );
$cdb->set_prop('mariadb',"status", "enabled" ); $cdb->set_prop('mariadb',"status", "enabled" );
$cdb->set_prop('roundcube',"status", 'enabled' ); $cdb->set_prop('roundcube',"status", 'enabled' );
$cdb->set_prop('roundcube',"access", "private" ); $cdb->set_prop('roundcube',"access", "private" );
@ -844,7 +857,7 @@ sub change_settings_filtering {
Subject Subject
SubjectTag) ) SubjectTag) )
{ {
$cdb->set_prop('spamassassin', $param, $c->param("Spam$param")); $cdb->set_prop('spamassassin', $param, $c->param("Spam$param"));
} }
my $patterns_status = $c->adjust_patterns() ? 'enabled' : 'disabled'; my $patterns_status = $c->adjust_patterns() ? 'enabled' : 'disabled';
@ -852,7 +865,7 @@ sub change_settings_filtering {
unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 ) unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 )
{ {
return $c->l('mai_ERROR_UPDATING_CONFIGURATION'); return $c->l('mai_ERROR_UPDATING_CONFIGURATION');
} }
return 'OK'; return 'OK';

View File

@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
%define name smeserver-manager %define name smeserver-manager
Name: %{name} Name: %{name}
%define version 11.0.0 %define version 11.0.0
%define release 21 %define release 22
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
License: GPL License: GPL
@ -108,6 +108,9 @@ true
%defattr(-,root,root) %defattr(-,root,root)
%changelog %changelog
* Tue Sep 24 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-22.sme
- fix typos, and tidy tabs [SME: 12744]
* Mon Sep 23 2024 Brian Read <brianr@koozali.org> 11.0.0-21.sme * Mon Sep 23 2024 Brian Read <brianr@koozali.org> 11.0.0-21.sme
- Remove both option for webmail [SME: 12744] - Remove both option for webmail [SME: 12744]
- Add in re-open DB for portforwarding and email settings. - Add in re-open DB for portforwarding and email settings.