Email settings files plus lex string audit program spec

This commit is contained in:
Brian Read 2025-07-04 09:05:08 +01:00
parent dfa582e6cb
commit c700add2a6
23 changed files with 3931 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,440 @@
package SrvMngr::Controller::Emailsettings;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
# Remember that each route must be unique (else they just overwrite each other).
# you cannot have get and post on the same name and url.
#
#----------------------------------------------------------------------
# heading : System
# description : E-Mail
# navigation : 4000 400
#
# name : emailsettings, method : get, url : /emailsettings, ctlact : Emailsettings#main
# name : emailsettingsu, method : post, url : /emailsettingsu, ctlact : Emailsettings#do_update
# name : emailsettingsd, method : get, url : /emailsettingsd, ctlact : Emailsettings#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Emailsettings
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8;
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
my %mai_data;
require '/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
%mai_data = ();
my $title = $c->l('mai_E-Mail');
my $modul = '';
$mai_data{'trt'} = 'FRONT';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($mai_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return 'ok' or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('mai_E-Mail');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mai_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'FRONT'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'FRONT'){
#Validate form parameters for panel FRONT
$ret = $c->validate_FRONT(\%mai_data);
$thispanel = 'FRONT';
}
if ($trt eq 'ACC'){
#Validate form parameters for panel ACC
$ret = $c->validate_ACC(\%mai_data);
$thispanel = 'ACC';
}
if ($trt eq 'FIL'){
#Validate form parameters for panel FIL
$ret = $c->validate_FIL(\%mai_data);
$thispanel = 'FIL';
}
if ($trt eq 'REC'){
#Validate form parameters for panel REC
$ret = $c->validate_REC(\%mai_data);
$thispanel = 'REC';
}
if ($trt eq 'DEL'){
#Validate form parameters for panel DEL
$ret = $c->validate_DEL(\%mai_data);
$thispanel = 'DEL';
}
if ($ret ne 'ok'){
$c->stash(error => $c->l($ret));
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'FRONT'){
#do whatever is required ...
$ret = $c->perform_FRONT(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_FRONT_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'ACC'){
#do whatever is required ...
$ret = $c->perform_ACC(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_ACC_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'FIL'){
#do whatever is required ...
$ret = $c->perform_FIL(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_FIL_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'REC'){
#do whatever is required ...
$ret = $c->perform_REC(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_REC_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'DEL'){
#do whatever is required ...
$ret = $c->perform_DEL(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_DEL_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$mai_data{'trt'} = 'FRONT';
} else {
$mai_data{'trt'} = 'none';
}
$c->do_display($mai_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('mai_E-Mail');
my $modul = '';
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mai_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'FRONT'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'FRONT'){
#Validate Get selected row (if applicable) FRONT
%selectedrow = $c->get_selected_FRONT($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'ACC'){
#Validate Get selected row (if applicable) ACC
%selectedrow = $c->get_selected_ACC($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'FIL'){
#Validate Get selected row (if applicable) FIL
%selectedrow = $c->get_selected_FIL($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'REC'){
#Validate Get selected row (if applicable) REC
%selectedrow = $c->get_selected_REC($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'DEL'){
#Validate Get selected row (if applicable) DEL
%selectedrow = $c->get_selected_DEL($mai_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$mai_data{$key} = $value;
}
# Where to go now
$mai_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'FRONT'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_FRONT();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'ACC'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_ACC();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'FIL'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_FIL();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'REC'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_REC();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'DEL'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_DEL();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
# and table control fields
# Data for panel
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
}
1;

View File

@ -0,0 +1,56 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-ACC" class="partial Emailsettings-ACC">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_POP_ACCESS_CONTROL'
<p><span class=label>
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
</span><span class=input>
% param 'POPAccess' => $c->get_current_pop3_access() unless param 'POPAccess';
%= select_field 'POPAccess' => $c->get_pop_opt(), class => 'input'
</span></p>
%=l 'mai_DESC_IMAP_ACCESS_CONTROL'
<p><span class=label>
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
</span><span class=input>
% param 'IMAPAccess' => $c->get_current_imap_access() unless param 'IMAPAccess';
%= select_field 'IMAPAccess' => $c->get_imap_opt(), class => 'input'
</span></p>
%=l 'mai_DESC_WEBMAIL'
<p><span class=label>
%=l 'mai_LABEL_WEBMAIL'
</span><span class=input>
% param 'WebMail' => $c->get_current_webmail_status() unless param 'WebMail';
%= select_field 'WebMail' => $c->get_webmail_opt(), class => 'input'
</span></p>
% my $btn = l('SAVE');
%= submit_button "$btn", class => 'action'
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@ -0,0 +1,89 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-DEL" class="partial Emailsettings-DEL">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
<h2>
%=l 'mai_TITLE_UNKNOWN'
</h2>
%=l 'mai_DESC_UNKNOWN'
<p><span class=label>
%=l 'mai_LABEL_UNKNOWN'
</span><span class=input>
% param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser';
%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => 'input'
</span></p>
<!--<hr class='menubar' />-->
<h2>
%=l 'mai_TITLE_DELEGATE'
</h2>
%=l 'mai_DESC_DELEGATE'
<p><span class=label>
%=l 'mai_LABEL_DELEGATE'
</span><span class=input>
% param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer';
%= text_field 'DelegateMailServer', class => 'input'
</span></p>
<!--<hr class='sectionbar' />-->
<h2>
%=l 'mai_TITLE_SMARTHOST'
</h2>
%=l 'mai_DESC_SMARTHOST'
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST'
</span><span class=input>
% param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost';
%= text_field 'SMTPSmartHost', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS'
</span><span class=input>
% param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status';
%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID'
</span><span class=input>
% param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid';
%= text_field 'SMTPAUTHPROXY_Userid', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD'
</span><span class=input>
% param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd';
%= password_field 'SMTPAUTHPROXY_Passwd', class => 'input'
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@ -0,0 +1,97 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-FIL" class="partial Emailsettings-FIL">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_VIRUS_SCAN'
<p><span class=label>
%=l 'mai_LABEL_VIRUS_SCAN'
</span><span class=input>
% param 'VirusStatus' => $mai_datas->{virusstatus} unless param 'VirusStatus';
%= select_field 'VirusStatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span><br></p>
%=l 'mai_DESC_SPAM_SCAN'
<p><span class=label>
%=l 'mai_LABEL_SPAM_SCAN'
</span><span class=input>
% param 'Spamstatus' => $mai_datas->{spamstatus} unless param 'Spamstatus';
%= select_field 'Spamstatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SENSITIVITY'
</span><span class=input>
% param 'SpamSensitivity' => $mai_datas->{spamsensitivity} unless param 'SpamSensitivity';
%= select_field 'SpamSensitivity' => $c->get_spam_sensitivity_opt(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_TAGLEVEL'
</span><span class=input>
% param 'SpamTagLevel' => $mai_datas->{spamtaglevel} unless param 'SpamTagLevel';
%= select_field 'SpamTagLevel' => $c->get_spam_level_options(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_REJECTLEVEL'
</span><span class=input>
% param 'SpamRejectLevel' => $mai_datas->{spamrejectlevel} unless param 'SpamRejectLevel';
%= select_field 'SpamRejectLevel' => $c->get_spam_level_options(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORTSPAM'
</span><span class=input>
% param 'SpamSortSpam' => $mai_datas->{spamsortspam} unless param 'SpamSortSpam';
%= select_field 'SpamSortSpam' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
%=l 'mai_DESC_SPAM_SUBJECT'
<p><span class=label>
%=l 'mai_LABEL_SPAM_SUBJECTTAG'
</span><span class=input>
% param 'SpamSubjectTag' => $mai_datas->{spamsubjecttag} unless param 'SpamSubjectTag';
%= select_field 'SpamSubjectTag' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SUBJECT'
</span><span class=input>
% param 'SpamSubject' => $mai_datas->{spamsubject} unless param 'SpamSubject';
%= text_field 'SpamSubject' => class => 'input'
</span></p>
%=l 'mai_DESC_BLOCK_EXECUTABLE_CONTENT'
<p><span class=label>
%=l 'mai_LABEL_CONTENT_TO_BLOCK'
</span><span class=input>
% param 'BlockExecutableContent' => $c->get_patterns_current_opt() unless param 'BlockExecutableContent';
%= select_field 'BlockExecutableContent' => $c->get_patterns_opt(), class => 'input', multiple => "1"
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@ -0,0 +1,155 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-FRONT" class="partial Emailsettings-FRONT">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
<h1><%= $title%></h1>
<br>
<br>
% my $btn = l('Modify');
<fieldset title='fred'>
<legend><%= $c->l('mai_DESC_STATE_ACCESS_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
</span><span class=data2>
%= $c->get_current_pop3_access( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
</span><span class=data2>
%= $c->get_current_imap_access( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_WEBMAIL'
</span><span class=data2>
%= $c->get_current_webmail_status( TRUE )
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'ACC'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_FILTERING_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_VIRUS_SCAN'
</span><span class=data2>
%= $c->get_virus_status(TRUE)
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SCAN'
</span><span class=data2>
%= $c->get_spam_status(TRUE)
</span></p>
<p><span class=label>
%=l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT'
</span><span class=data2>
%= $c->get_patterns_status(TRUE)
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'FIL'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_RECEPTION_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_MODE'
</span><span class=data2>
%= $mai_datas->{fetchmailmethod}
</span></p>
% my $smtp_mesg;
% $smtp_mesg=l('SMTP port %u allow client to authenticate:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
</span><span class=data2>
%= $c->get_current_smtp_auth( TRUE )
</span></p>
% $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
</span><span class=data2>
%= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE )
</span></p>
% $smtp_mesg=l 'Submission port %u status:';
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
</span><span class=data2>
%= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE )
</span></p>
<br />
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'REC'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_DELIVERY_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_UNKNOWN'
</span><span class=data2>
%= $c->get_emailunknownuser_status( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_DELEGATE'
</span><span class=data2>
%= $c->get_value('DelegateMailServer')
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST'
</span><span class=data2>
%= $c->get_value('SMTPSmartHost')
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'DEL'
% end
</fieldset>
</div>

View File

@ -0,0 +1,158 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-REC" class="partial Emailsettings-REC">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_MODE'
<p><span class=label>
%=l 'mai_LABEL_MODE'
</span><span class=input>
% param 'FetchmailMethod' => $mai_datas->{fetchmailmethod} unless param 'FetchmailMethod';
<!--
<pre>
%= dumper $mai_datas->{fetchmailmethod}
%= dumper $c->get_retrieval_opt()
%= param 'FetchmailMethod'
</pre>
-->
%= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class => 'input'
</span></p>
%#=l 'mai_DESC_SMTP_AUTH_CONTROL'
<br />
%= l "SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client."
<br />
%= l "SMTPS port (465) will require implicit SSL/TLS then authenticate to send."
<br />
%= l "SMTP Submission port (587) will require STARTTLS, then authenticate to send."
<br />
% my $smtp_mesg=l('SMTP port %u allow client to authenticate:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
</span><span class=input>
% param 'SMTPAuth' => $c->get_current_smtp_auth( FALSE ) unless param 'SMTPAuth';
<!--
<pre>
%= dumper $c->get_smtp_auth_opt()
%= dumper $c->get_current_smtp_auth(FALSE)
%= dumper $c->get_db_prop("qpsmtpd","Authentication")
%= param 'SMTPAuth'
</pre>
-->
%= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => 'input'
</span></p>
% my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
</span><span class=input>
% param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth';
%= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
</span></p>
%my $smtp_mesg=l('Submission port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
</span><span class=input>
% param 'uSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE) unless param 'uSMTPAuth';
<!--
<pre>
%= dumper $c->get_smtp_ssl_auth_opt()
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE)
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE)
%= dumper $c->get_db_prop("uqpsmtpd","access")
%= param 'uSMTPAuth'
</pre>
-->
%= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
</span></p>
<!--<hr class="sectionbar" />-->
<h2>
%=l 'mai_TITLE_SECONDARY'
</h2>
%=l 'mai_DESC_SECONDARY'
<p><span class=label>
%=l 'mai_LABEL_SECONDARY'
</span><span class=input>
% param 'SecondaryMailServer' => $mai_datas->{secondarymailserver} unless param 'SecondaryMailServer';
%= text_field 'SecondaryMailServer', class => 'input'
</span></p>
%=l 'mai_DESC_FETCH_PERIOD'
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD'
</span><span class=input>
% param 'FreqOffice' => $mai_datas->{freqoffice} unless param 'FreqOffice';
%= select_field 'FreqOffice' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD_NIGHTS'
</span><span class=input>
% param 'FreqOutside' => $mai_datas->{freqoutside} unless param 'FreqOutside';
%= select_field 'FreqOutside' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD_WEEKENDS'
</span><span class=input>
% param 'FreqWeekend' => $mai_datas->{freqweekend} unless param 'FreqWeekend';
%= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_POP_ACCOUNT'
</span><span class=input>
% param 'SecondaryMailAccount' => $mai_datas->{secondarymailaccount} unless param 'SecondaryMailAccount';
%= text_field 'SecondaryMailAccount', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_POP_PASS'
</span><span class=input>
% param 'SecondaryMailPassword' => $mai_datas->{secondarymailpassword} unless param 'SecondaryMailPassword';
%= password_field 'SecondaryMailPassword', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORT_METHOD'
</span><span class=input>
% param 'SpecifyHeader' => $mai_datas->{specifyheader} unless param 'SpecifyHeader';
%= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORT_HEADER'
</span><span class=input>
% param 'SecondaryMailEnvelope' => $mai_datas->{secondarymailenvelope} unless param 'SecondaryMailEnvelope';
%= text_field 'SecondaryMailEnvelope', class => 'input'
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@ -0,0 +1,14 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
*/
.Emailsettings-panel {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}

View File

@ -0,0 +1,68 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
% layout 'default', title => "Sme server 2 - E-Mail", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/emailsettings.css'
%= javascript '/js/emailsettings.js'
<div id="module" class="module Emailsettings-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $mai_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
%= $c->l($c->stash('success'));
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
%= $c->l($c->stash('error'));
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($mai_data->{trt} eq "FRONT") {
%= include 'partials/_mai_FRONT'
%}
% if ($mai_data->{trt} eq "ACC") {
%= include 'partials/_mai_ACC'
%}
% if ($mai_data->{trt} eq "FIL") {
%= include 'partials/_mai_FIL'
%}
% if ($mai_data->{trt} eq "REC") {
%= include 'partials/_mai_REC'
%}
% if ($mai_data->{trt} eq "DEL") {
%= include 'partials/_mai_DEL'
%}
</div>
%end

View File

@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
//
$(document).ready(function() {
});

View File

@ -0,0 +1,152 @@
'mai_FORM_TITLE' => 'E-mail settings',
'E-mail' => 'E-mail',
'mai_SUCCESS' => 'The new e-mail settings have been saved.',
'mai_NEVER' => 'not at all',
'mai_EVERY5MIN' => 'Every 5 minutes',
'mai_EVERY15MIN' => 'Every 15 minutes',
'mai_EVERY30MIN' => 'Every 30 minutes',
'mai_EVERYHOUR' => 'Every hour',
'mai_EVERY2HRS' => 'Every 2 hours',
'mai_STANDARD' => 'Standard (SMTP)',
'mai_ETRN' => 'ETRN (SMTP with client request)',
'mai_DEFAULT' => 'Default',
'mai_SPECIFY_BELOW' => 'Specify below',
'mai_MULTIDROP' => 'multi-drop',
'mai_LABEL_MODE' => 'E-mail retrieval mode',
'mai_DESC_MODE' => 'The e-mail retrieval mode can be set to
standard (for dedicated Internet connections), ETRN (recommended
for dialup connections), or multi-drop (for dialup connections if
ETRN is not supported by your Internet provider). Note that
multi-drop mode is the only option available when the server is
configured in private server and gateway mode.',
'mai_LABEL_DELEGATE' => 'Address of internal mail server',
'mai_TITLE_DELEGATE' => 'Delegate mail servers',
'mai_DESC_DELEGATE' => 'Your server includes a complete, full-featured e-mail server. However,
if for some reason you wish to delegate e-mail processing to
another system, specify the IP address of the delegate system
here. For normal operation, leave this field blank.',
'mai_LABEL_SECONDARY' => 'Secondary mail server',
'mai_TITLE_SECONDARY' => 'ETRN or multi-drop settings',
'mai_DESC_SECONDARY' => 'For ETRN or multi-drop, specify the hostname or IP address of your
secondary mail server. (If using the standard e-mail setup, this
field can be left blank.)',
'mai_DESC_FETCH_PERIOD' => 'For ETRN or multi-drop, you can control how frequently this server
contacts your secondary e-mail server to fetch e-mail. More
frequent connections mean that you receive your e-mail more
quickly, but also cause Internet requests to be sent more often,
possibly increasing your phone and Internet charges.',
'mai_LABEL_FETCH_PERIOD' => 'During office hours (8:00 AM to 6:00 PM) on weekdays',
'mai_LABEL_FETCH_PERIOD_NIGHTS' => 'Outside office hours (6:00 PM to 8:00 AM) on weekdays',
'mai_LABEL_FETCH_PERIOD_WEEKENDS' => 'During the weekend',
'mai_DESC_POP_ACCOUNT' => 'For multi-drop e-mail, specify the POP user account and password.
(If using standard or ETRN e-mail, these fields can be blank.)
Also, for multi-drop, you can either use the default mail sorting
method, or you can specify a particular message header to use for
mail sorting.',
'mai_LABEL_POP_PASS' => 'POP user password (for multi-drop)',
'mai_LABEL_POP_ACCOUNT' => 'POP user account (for multi-drop)',
'mai_LABEL_SORT_METHOD' => 'Select sort method (for multi-drop)',
'mai_LABEL_SORT_HEADER' => 'Select sort header (for multi-drop)',
'mai_LABEL_FETCH_PROTO' => 'Protocol (for multi-drop)',
'mai_LABEL_FETCH_SECURE' => 'Tunnel over SSL (for multi-drop)',
'mai_AUTO' => 'Automatic',
'mai_ENABLED_BOTH' => 'Allow both HTTP and HTTPS',
'mai_ENABLED_SECURE_ONLY' => 'Allow HTTPS (secure)',
'mai_ONLY_LOCAL_NETWORK_SSL' => 'Allow HTTPS (secure) from local networks',
'mai_INSECURE_POP3' => 'Allow both POP3 and POP3S',
'mai_ALLOW_PRIVATE' => 'Allow private',
'mai_SECURE_POP3' => 'Allow private and public (secure POP3S)',
'mai_INSECURE_IMAP' => 'Allow both IMAP and IMAPS',
'mai_SECURE_IMAP' => 'Allow private and public (secure IMAPS)',
'mai_INSECURE_SMTP' => 'Allow both SMTP and SSMTP',
'mai_SECURE_SMTP' => 'Allow SSMTP (secure)',
'mai_LABEL_POP_ACCESS_CONTROL' => 'POP3 server access',
'mai_LABEL_IMAP_ACCESS_CONTROL' => 'IMAP server access',
'mai_LABEL_SMTP_AUTH_CONTROL' => 'SMTP authentication',
'mai_FORWARD_TO_ADMIN' => 'Send to administrator',
'mai_FORWARD_TO' => 'Send to',
'mai_RETURN_TO_SENDER' => 'Reject',
'mai_LABEL_UNKNOWN' => 'E-mail to unknown users',
'mai_TITLE_UNKNOWN' => 'Unknown Users',
'mai_DESC_UNKNOWN' => 'Selecting Reject (recommended setting) will configure the server to only
accept mail for valid email addresses (for example users, groups, pseudonyms).
Mail for other addresses will be rejected.',
'mai_LABEL_SMARTHOST' => 'Address of Internet provider\'s mail server',
'mai_TITLE_SMARTHOST' => 'SMTP server',
'mai_DESC_SMARTHOST' => 'The server can deliver outgoing messages directly to their
destination (recommended in most cases) or can deliver them via
your Internet provider\'s SMTP server (recommended if you have an
unreliable Internet connection or are using a residential Internet
service). If using your Internet provider\'s SMTP server, specify
its hostname or IP address below. Otherwise leave this field blank.',
'mai_INVALID_SMARTHOST' => 'The smarthost name you entered is not a valid internet domain name and is not blank',
'mai_INVALID_DELEGATE' => 'The delegate host name you entered is not a valid internet domain name and is not blank',
'mai_DESC_POP_ACCESS_CONTROL' => 'You can control POP3 server access. The setting \'Allow access
only from local networks\' allows POP3 access only from your
local network(s). The POP3S setting can be used to provide
encrypted external access to your POP3 server. We recommend
leaving this setting \'Allow access only from local networks\'
unless you have a specific reason to do otherwise.',
'mai_DESC_IMAP_ACCESS_CONTROL' => 'You can control IMAP server access. The setting \'Allow access
only from local networks\' allows IMAP access only from your
local network(s). The IMAPS setting can be used to provide
encrypted external access to your IMAP server. We recommend
leaving this setting \'Allow access only from local networks\'
unless you have a specific reason to do otherwise.',
'mai_DESC_SMTP_AUTH_CONTROL' => 'You can provide authenticated access to your SMTP server, or
set it to Disabled.
The SSMTP setting requires <b>all</b> users to use SSL/TLS
authentication. The SMTP and SSMTP option additionally allows
STARTTLS to be used to ensure secure authentication.',
'mai_DESC_WEBMAIL' => 'You can enable or disable webmail on this system. Webmail allows
users to access their mail through a regular web browser by
pointing the browser to https://[_1]/webmail,and
logging in to their account.',
'mai_LABEL_WEBMAIL' => 'Webmail access',
'mai_LABEL_BLOCK_EXECUTABLE_CONTENT' => 'Executable content blocking',
'mai_LABEL_CONTENT_TO_BLOCK' => 'Content to block',
'mai_DESC_BLOCK_EXECUTABLE_CONTENT' => 'You can block executable content in e-mail attachments
by highlighting the executable attachment types you wish to
block. E-mail containing these attachment types will
be automatically returned to the sender.',
'mai_UNACCEPTABLE_CHARS' => 'This field requires a valid e-mail address, which must include
the @ symbol and a domain name.',
'mai_DESC_STATE_ACCESS' => 'E-mail access',
'mai_DESC_STATE_ACCESS_BUTTON' => 'Change e-mail access settings',
'mai_DESC_STATE_RECEPTION' => 'E-mail reception',
'mai_DESC_STATE_RECEPTION_BUTTON' => 'Change e-mail reception settings',
'mai_DESC_STATE_DELIVERY' => 'E-mail delivery',
'mai_DESC_STATE_DELIVERY_BUTTON' => 'Change e-mail delivery settings',
'mai_DESC_STATE_FILTERING_BUTTON' => 'Change e-mail filtering settings',
'mai_LABEL_VIRUS_SCAN' => 'Virus scanning',
'mai_DESC_VIRUS_SCAN' => 'You can scan incoming and outgoing e-mail for viruses. If scanning is enabled and a virus is detected, the e-mail will be rejected and returned to the
sender.',
'mai_LABEL_SPAM_SCAN' => 'Spam filtering',
'mai_DESC_SPAM_SCAN' => 'You can scan e-mail for spam. If Spam filtering is
enabled, an X-Spam-Status: header is added to each
message, which can be used for filtering spam.
You can adjust the sensitivity of the Spam detection
process from the default of medium. For fine-grained
control, you can set the Spam sensitivity to Custom
and then choose a custom tagging level, and
optionally a level at which to reject the message.',
'mai_LABEL_SPAM_SUBJECT' => 'SPAM subject prefix',
'mai_DESC_SPAM_SUBJECT' => 'You can enable to add a tag to the subject of each
message that is classified as SPAM.
The value for this tag can be defined below.',
'mai_LABEL_SPAM_SENSITIVITY' => 'Spam sensitivity',
'mai_LABEL_SPAM_TAGLEVEL' => 'Custom spam tagging level',
'mai_LABEL_SPAM_REJECTLEVEL' => 'Custom spam rejection level',
'mai_LABEL_SPAM_SUBJECTTAG' => 'Modify subject of spam messages',
'mai_LABEL_SORTSPAM' => 'Sort spam into junkmail folder',
'mai_VERYHIGH' => 'Very high',
'mai_HIGH' => 'High',
'mai_MEDIUM' => 'Medium',
'mai_LOW' => 'Low',
'mai_VERYLOW' => 'Very low',
'mai_CUSTOM' => 'Custom',
'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' => 'SMTP Authentication for Internet provider',
'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' => 'Mail server user id',
'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' => 'Mail server password',
'mai_VALIDATION_SMTPAUTH_NONBLANK' => 'This field cannot be left blank if SMTP Authentication is
enabled.',

49
html/mai-ACC.html Normal file
View File

@ -0,0 +1,49 @@
<div id='module' class='module emailaccess-panel'>
<h1>E-mail settings</h1>
<form action="/smanager/emailsettingd" method="POST">
You can control POP3 server access. The setting &#39;Allow access
only from local networks&#39; allows POP3 access only from your
local network(s). The POP3S setting can be used to provide
encrypted external access to your POP3 server. We recommend
leaving this setting &#39;Allow access only from local networks&#39;
unless you have a specific reason to do otherwise.
<p><span class=label>
POP3 server access
</span><span class=input>
<select class="input" name="POPAccess"><option value="disabled">Disabled</option><option selected value="private">Allow access only from local networks</option><option value="publicSSL">Allow private and public (secure POP3S)</option><option value="public">Allow both POP3 and POP3S</option></select>
</span></p>
You can control IMAP server access. The setting &#39;Allow access
only from local networks&#39; allows IMAP access only from your
local network(s). The IMAPS setting can be used to provide
encrypted external access to your IMAP server. We recommend
leaving this setting &#39;Allow access only from local networks&#39;
unless you have a specific reason to do otherwise.
<p><span class=label>
IMAP server access
</span><span class=input>
<select class="input" name="IMAPAccess"><option value="disabled">Disabled</option><option selected value="private">Allow access only from local networks</option><option value="publicSSL">Allow private and public (secure IMAPS)</option><option value="public">Allow both IMAP and IMAPS</option></select>
</span></p>
You can enable or disable webmail on this system. Webmail allows
users to access their mail through a regular web browser by
pointing the browser to https:///webmail,and
logging in to their account.
<p><span class=label>
Webmail access
</span><span class=input>
<select class="input" name="WebMail"><option value="disabled">Disabled</option><option selected value="enabledSSL">Allow HTTPS (secure)</option><option value="localnetworkSSL">Allow HTTPS (secure) from local networks</option></select>
</span></p>
<input class="action" type="submit" value="Save">
<input name="trt" type="hidden" value="ACC">
</form>
</div>

79
html/mai-DEL.html Normal file
View File

@ -0,0 +1,79 @@
<div id='module' class='module emaildeliver-panel'>
<h1>E-mail settings</h1>
<form action="/smanager/emailsettingd" method="POST">
<h2>
Unknown Users
</h2>
Selecting Reject (recommended setting) will configure the server to only
accept mail for valid email addresses (for example users, groups, pseudonyms).
Mail for other addresses will be rejected.
<p><span class=label>
E-mail to unknown users
</span><span class=input>
<select class="input" name="EmailUnknownUser"><option value="admin">Send to administrator</option><option selected value="returntosender">Reject</option><option value="abuse">Send to abuse</option><option value="admin_raidreport">Send to admin_raidreport</option><option value="anonymous">Send to anonymous</option><option value="brian.read">Send to brian.read</option><option value="brian_read">Send to brian_read</option><option value="brianr">Send to brianr</option><option value="mailer-daemon">Send to mailer-daemon</option><option value="postmaster">Send to postmaster</option></select>
</span></p>
<!--<hr class='menubar' />-->
<h2>
Delegate mail servers
</h2>
Your server includes a complete, full-featured e-mail server. However,
if for some reason you wish to delegate e-mail processing to
another system, specify the IP address of the delegate system
here. For normal operation, leave this field blank.
<p><span class=label>
Address of internal mail server
</span><span class=input>
<input class="input" name="DelegateMailServer" type="text" value="">
</span></p>
<!--<hr class='sectionbar' />-->
<h2>
SMTP server
</h2>
The server can deliver outgoing messages directly to their
destination (recommended in most cases) or can deliver them via
your Internet provider&#39;s SMTP server (recommended if you have an
unreliable Internet connection or are using a residential Internet
service). If using your Internet provider&#39;s SMTP server, specify
its hostname or IP address below. Otherwise leave this field blank.
<p><span class=label>
Address of Internet provider&#39;s mail server
</span><span class=input>
<input class="input" name="SMTPSmartHost" type="text" value="">
</span></p>
<p><span class=label>
SMTP Authentication for Internet provider
</span><span class=input>
<select class="input" name="SMTPAUTHPROXY_status"><option selected value="disabled">Disabled</option><option value="enabled">Enabled</option></select>
</span></p>
<p><span class=label>
Mail server user id
</span><span class=input>
<input class="input" name="SMTPAUTHPROXY_Userid" type="text" value="">
</span></p>
<p><span class=label>
Mail server password
</span><span class=input>
<input class="input" name="SMTPAUTHPROXY_Passwd" type="password">
</span></p>
<input class="action" type="submit" value="Save">
<input name="trt" type="hidden" value="DEL">
</form>
</div>

88
html/mai-FIL.html Normal file
View File

@ -0,0 +1,88 @@
<div id='module' class='module emailfilter-panel'>
<h1>E-mail settings</h1>
<form action="/smanager/emailsettingd" method="POST">
You can scan incoming and outgoing e-mail for viruses. If scanning is enabled and a virus is detected, the e-mail will be rejected and returned to the
sender.
<p><span class=label>
Virus scanning
</span><span class=input>
<select class="input" name="VirusStatus"><option value="disabled">Disabled</option><option selected value="enabled">Enabled</option></select>
</span><br></p>
You can scan e-mail for spam. If Spam filtering is
enabled, an X-Spam-Status: header is added to each
message, which can be used for filtering spam.
You can adjust the sensitivity of the Spam detection
process from the default of medium. For fine-grained
control, you can set the Spam sensitivity to Custom
and then choose a custom tagging level, and
optionally a level at which to reject the message.
<p><span class=label>
Spam filtering
</span><span class=input>
<select class="input" name="Spamstatus"><option selected value="disabled">Disabled</option><option value="enabled">Enabled</option></select>
</span></p>
<p><span class=label>
Spam sensitivity
</span><span class=input>
<select class="input" name="SpamSensitivity"><option value="verylow">Very low</option><option value="low">Low</option><option selected value="medium">Medium</option><option value="high">High</option><option value="veryhigh">Very high</option><option value="custom">Custom</option></select>
</span></p>
<p><span class=label>
Custom spam tagging level
</span><span class=input>
<select class="input" name="SpamTagLevel"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option selected value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option></select>
</span></p>
<p><span class=label>
Custom spam rejection level
</span><span class=input>
<select class="input" name="SpamRejectLevel"><option selected value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option></select>
</span></p>
<p><span class=label>
Sort spam into junkmail folder
</span><span class=input>
<select class="input" name="SpamSortSpam"><option value="disabled">Disabled</option><option selected value="enabled">Enabled</option></select>
</span></p>
You can enable to add a tag to the subject of each
message that is classified as SPAM.
The value for this tag can be defined below.
<p><span class=label>
Modify subject of spam messages
</span><span class=input>
<select class="input" name="SpamSubjectTag"><option selected value="disabled">Disabled</option><option value="enabled">Enabled</option></select>
</span></p>
<p><span class=label>
SPAM subject prefix
</span><span class=input>
<input class="input" name="SpamSubject" type="text" value="[SPAM]">
</span></p>
You can block executable content in e-mail attachments
by highlighting the executable attachment types you wish to
block. E-mail containing these attachment types will
be automatically returned to the sender.
<p><span class=label>
Content to block
</span><span class=input>
<select class="input" multiple="1" name="BlockExecutableContent"><option value="AHhIYW5k">PIF file (AHhIYW5k)</option><option value="AHhUYXgg">PIF file (AHhUYXgg)</option><option value="AMkgICAg">PIF file (AMkgICAg)</option><option value="AMlIbDk5Lm">PIF file (AMlIbDk5Lm)</option><option value="GIF01">GIF file from old virus</option><option value="TVoAAAAAA">PC executables (TVoAAAAAA)</option><option value="TVoAAAEAAA">PC executables (TVoAAAEAAA)</option><option value="TVoAAAQAA">PC executables (TVoAAAQAA)</option><option value="TVoAACoAG">PC executables (TVoAACoAG)</option><option value="TVoAAD8AA">PC executables (TVoAAD8AA)</option><option value="TVoFAQUAA">PC executables (TVoFAQUAA)</option><option value="TVoIARMAA">PC executables (TVoIARMAA)</option><option value="TVouARsAA">PC executables (TVouARsAA)</option><option value="TVp1AQEAAAAE">PC executables (TVp1AQEAAAAE)</option><option value="TVpAALQAc">PC executables (TVpAALQAc)</option><option value="TVpLRVJOR">PC executables (TVpLRVJOR)</option><option value="TVpQAAIAA">PC executables (TVpQAAIAA)</option><option value="TVpyAXkAX">PC executables (TVpyAXkAX)</option><option value="TVqQAAMAA">PC executables (TVqQAAMAA)</option><option value="TVqgAAEAAAAFAAAA">PC executables (TVqgAAEAAAAFAAAA)</option><option value="TVrQAT8AA">PC executables (TVrQAT8AA)</option><option value="TVrhARwAk">PC executables (TVrhARwAk)</option><option value="TVrmAU4AA">PC executables (TVrmAU4AA)</option><option value="UmFyIRoHA">Rar archive (UmFyIRoHA)</option><option value="ZIPV1">Zip archive data, at least v1.0 to extract</option><option value="ZIPV2">Zip archive data, at least v2.0 to extract</option><option value="ZIPV3">Zip archive data, variant 3</option><option value="ZIPVOSX">Zip archive data, created on OSX</option></select>
</span></p>
<input class="action" type="submit" value="Save">
<input name="trt" type="hidden" value="FIL">
</form>
</div>

137
html/mai-FRONT.html Normal file
View File

@ -0,0 +1,137 @@
<div id='module' class='module emailsettings-panel'>
<h1>E-mail settings</h1>
<br>
<br>
<fieldset title='fred'>
<legend>Change e-mail access settings</legend>
<form action="/smanager/emailsettings" method="POST">
<p><span class=label>
POP3 server access
</span><span class=data2>
Allow access only from local networks
</span></p>
<p><span class=label>
IMAP server access
</span><span class=data2>
Allow access only from local networks
</span></p>
<p><span class=label>
Webmail access
</span><span class=data2>
Allow HTTPS (secure)
</span></p>
<br>
<div class='center'>
<input class="action" type="submit" value="Modify">
</div>
<input name="trt" type="hidden" value="ACC">
</form> </fieldset>
<br>
<fieldset>
<legend>Change e-mail filtering settings</legend>
<form action="/smanager/emailsettings" method="POST">
<p><span class=label>
Virus scanning
</span><span class=data2>
Enabled
</span></p>
<p><span class=label>
Spam filtering
</span><span class=data2>
Disabled
</span></p>
<p><span class=label>
Executable content blocking
</span><span class=data2>
Disabled
</span></p>
<br>
<div class='center'>
<input class="action" type="submit" value="Modify">
</div>
<input name="trt" type="hidden" value="FIL">
</form> </fieldset>
<br>
<fieldset>
<legend>Change e-mail reception settings</legend>
<form action="/smanager/emailsettings" method="POST">
<p><span class=label>
E-mail retrieval mode
</span><span class=data2>
standard
</span></p>
<p><span class=label>
SMTP port 25 allow client to authenticate:
</span><span class=data2>
Only allow insecure access
</span></p>
<p><span class=label>
SMTPS SSL/TLS auth: port 465 status:
</span><span class=data2>
Allow public access
</span></p>
<p><span class=label>
Submission port 587 status:
</span><span class=data2>
Allow public access
</span></p>
<br />
<div class='center'>
<input class="action" type="submit" value="Modify">
</div>
<input name="trt" type="hidden" value="REC">
</form> </fieldset>
<br>
<fieldset>
<legend>Change e-mail delivery settings</legend>
<form action="/smanager/emailsettings" method="POST">
<p><span class=label>
E-mail to unknown users
</span><span class=data2>
Reject
</span></p>
<p><span class=label>
Address of internal mail server
</span><span class=data2>
</span></p>
<p><span class=label>
Address of Internet provider&#39;s mail server
</span><span class=data2>
</span></p>
<br>
<div class='center'>
<input class="action" type="submit" value="Modify">
</div>
<input name="trt" type="hidden" value="DEL">
</form> </fieldset>
</div>

188
html/mai-REC.html Normal file
View File

@ -0,0 +1,188 @@
<div id='module' class='module emailreceive-panel'>
<h1>E-mail settings</h1>
<form action="/smanager/emailsettingd" method="POST">
The e-mail retrieval mode can be set to
standard (for dedicated Internet connections), ETRN (recommended
for dialup connections), or multi-drop (for dialup connections if
ETRN is not supported by your Internet provider). Note that
multi-drop mode is the only option available when the server is
configured in private server and gateway mode.
<p><span class=label>
E-mail retrieval mode
</span><span class=input>
<!--
<pre>
&quot;standard&quot;
[
[
&quot;Standard (SMTP)&quot;,
&quot;standard&quot;
],
[
&quot;ETRN (SMTP with client request)&quot;,
&quot;etrn&quot;
],
[
&quot;multi-drop&quot;,
&quot;multidrop&quot;
]
]
standard
</pre>
-->
<select class="input" name="FetchmailMethod"><option selected value="standard">Standard (SMTP)</option><option value="etrn">ETRN (SMTP with client request)</option><option value="multidrop">multi-drop</option></select>
</span></p>
<br />
SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client.
<br />
SMTPS port (465) will require implicit SSL/TLS then authenticate to send.
<br />
SMTP Submission port (587) will require STARTTLS, then authenticate to send.
<br />
<p><span class=label>
SMTP port 25 allow client to authenticate:
</span><span class=input>
<!--
<pre>
[
[
&quot;Allow SSMTP (secure)&quot;,
&quot;publicSSL&quot;
],
[
&quot;Only allow insecure access&quot;,
&quot;public&quot;
],
[
&quot;Disabled&quot;,
&quot;disabled&quot;
]
]
&quot;public&quot;
&quot;disabled&quot;
public
</pre>
-->
<select class="input" name="SMTPAuth"><option value="publicSSL">Allow SSMTP (secure)</option><option selected value="public">Only allow insecure access</option><option value="disabled">Disabled</option></select>
</span></p>
<p><span class=label>
SMTPS SSL/TLS auth: port 465 status:
</span><span class=input>
<select class="input" name="sSMTPAuth"><option selected value="public">Allow public access</option><option value="local">Allow local access only</option><option value="disabled">Disabled</option></select>
</span></p>
<p><span class=label>
Submission port 587 status:
</span><span class=input>
<!--
<pre>
[
[
&quot;Allow public access&quot;,
&quot;public&quot;
],
[
&quot;Allow local access only&quot;,
&quot;local&quot;
],
[
&quot;Disabled&quot;,
&quot;disabled&quot;
]
]
&quot;public&quot;
&quot;public&quot;
&quot;public&quot;
public
</pre>
-->
<select class="input" name="uSMTPAuth"><option selected value="public">Allow public access</option><option value="local">Allow local access only</option><option value="disabled">Disabled</option></select>
</span></p>
<!--<hr class="sectionbar" />-->
<h2>
ETRN or multi-drop settings
</h2>
For ETRN or multi-drop, specify the hostname or IP address of your
secondary mail server. (If using the standard e-mail setup, this
field can be left blank.)
<p><span class=label>
Secondary mail server
</span><span class=input>
<input class="input" name="SecondaryMailServer" type="text" value="mail.myisp.xxx">
</span></p>
For ETRN or multi-drop, you can control how frequently this server
contacts your secondary e-mail server to fetch e-mail. More
frequent connections mean that you receive your e-mail more
quickly, but also cause Internet requests to be sent more often,
possibly increasing your phone and Internet charges.
<p><span class=label>
During office hours (8:00 AM to 6:00 PM) on weekdays
</span><span class=input>
<select class="input" name="FreqOffice"><option value="never">not at all</option><option value="every5min">Every 5 minutes</option><option selected value="every15min">Every 15 minutes</option><option value="every30min">Every 30 minutes</option><option value="everyhour">Every hour</option><option value="every2hrs">Every 2 hours</option></select>
</span></p>
<p><span class=label>
Outside office hours (6:00 PM to 8:00 AM) on weekdays
</span><span class=input>
<select class="input" name="FreqOutside"><option value="never">not at all</option><option value="every5min">Every 5 minutes</option><option selected value="every15min">Every 15 minutes</option><option value="every30min">Every 30 minutes</option><option value="everyhour">Every hour</option><option value="every2hrs">Every 2 hours</option></select>
</span></p>
<p><span class=label>
During the weekend
</span><span class=input>
<select class="input" name="FreqWeekend"><option value="never">not at all</option><option value="every5min">Every 5 minutes</option><option selected value="every15min">Every 15 minutes</option><option value="every30min">Every 30 minutes</option><option value="everyhour">Every hour</option><option value="every2hrs">Every 2 hours</option></select>
</span></p>
<p><span class=label>
POP user account (for multi-drop)
</span><span class=input>
<input class="input" name="SecondaryMailAccount" type="text" value="popaccount">
</span></p>
<p><span class=label>
POP user password (for multi-drop)
</span><span class=input>
<input class="input" name="SecondaryMailPassword" type="password">
</span></p>
<p><span class=label>
Select sort method (for multi-drop)
</span><span class=input>
<select class="input" name="SpecifyHeader"><option selected value="off">Default</option><option value="on">Specify below</option></select>
</span></p>
<p><span class=label>
Select sort header (for multi-drop)
</span><span class=input>
<input class="input" name="SecondaryMailEnvelope" type="text" value>
</span></p>
<input class="action" type="submit" value="Save">
<input name="trt" type="hidden" value="REC">
</form>
</div>

33
json5/Emailsettings.json5 Normal file
View File

@ -0,0 +1,33 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:35:42
//
{
'PackageName': 'Emailsettings',
'prefix': 'mai',
'MenuHeading': 'System',
'MenuDescription': 'E-Mail',
'MenuNavigation': '4000 400',
'firstPanel': 'FRONT',
'html': [
{
'Name': 'front',
'route': 'FRONT',
},
{
'Name': 'acc',
'route': 'ACC',
},
{
'Name': 'file',
'route': 'FIL',
},
{
'Name': 'rec',
'route': 'REC',
},
{
'Name': 'del',
'route': 'DEL',
},
]
}

97
json5/mai-ACC.json5 Normal file
View File

@ -0,0 +1,97 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:36:06
//
{
'PackageName': 'mai-ACC',
'prefix': 'acc',
'MenuHeading': 'Miscellaneous',
'MenuDescription': 'mai- A C C',
'MenuNavigation': '2000 400',
'firstPanel': 'PARAMS',
'signalEvent': 'smeserver-mai-acc-update',
'html': [
{
'Name': 'params',
'route': 'PARAMS',
'Header': 'E-mail settings',
'SubHeader': 'Manage mai-ACC settings:',
'Paragraph1': 'POP3 server accessDisabledAllow access only from local networksAllow private and public (secure POP3S)Allow both POP3 and POP3S',
'Input1': {
'Type': 'Select',
'Value': '',
'Name': 'POPAccess',
'Label': 'POPAccess',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'private',
'Text': 'Allow access only from local networks'
},
{
'Value': 'publicSSL',
'Text': 'Allow private and public (secure POP3S)'
},
{
'Value': 'public',
'Text': 'Allow both POP3 and POP3S'
}
]
},
'Paragraph2': 'IMAP server accessDisabledAllow access only from local networksAllow private and public (secure IMAPS)Allow both IMAP and IMAPS',
'Input2': {
'Type': 'Select',
'Value': '',
'Name': 'IMAPAccess',
'Label': 'IMAPAccess',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'private',
'Text': 'Allow access only from local networks'
},
{
'Value': 'publicSSL',
'Text': 'Allow private and public (secure IMAPS)'
},
{
'Value': 'public',
'Text': 'Allow both IMAP and IMAPS'
}
]
},
'Paragraph3': 'Webmail accessDisabledAllow HTTPS (secure)Allow HTTPS (secure) from local networks',
'Input3': {
'Type': 'Select',
'Value': '',
'Name': 'WebMail',
'Label': 'WebMail',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabledSSL',
'Text': 'Allow HTTPS (secure)'
},
{
'Value': 'localnetworkSSL',
'Text': 'Allow HTTPS (secure) from local networks'
}
]
},
'Input4': {
'Type': 'Submit',
'Value': 'Save',
'Name': null,
'Label': null
}
}
]
}

120
json5/mai-DEL.json5 Normal file
View File

@ -0,0 +1,120 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:37:08
//
{
'PackageName': 'mai-DEL',
'prefix': 'del',
'MenuHeading': 'Miscellaneous',
'MenuDescription': 'mai- D E L',
'MenuNavigation': '2000 400',
'firstPanel': 'PARAMS',
'signalEvent': 'smeserver-mai-del-update',
'html': [
{
'Name': 'params',
'route': 'PARAMS',
'Header': 'E-mail settings',
'SubHeader': 'SMTP server',
'Paragraph1': 'E-mail to unknown usersSend to administratorRejectSend to abuseSend to admin_raidreportSend to anonymousSend to brian.readSend to brian_readSend to brianrSend to mailer-daemonSend to postmaster',
'Input1': {
'Type': 'Select',
'Value': '',
'Name': 'EmailUnknownUser',
'Label': 'EmailUnknownUser',
'Options': [
{
'Value': 'admin',
'Text': 'Send to administrator'
},
{
'Value': 'returntosender',
'Text': 'Reject'
},
{
'Value': 'abuse',
'Text': 'Send to abuse'
},
{
'Value': 'admin_raidreport',
'Text': 'Send to admin_raidreport'
},
{
'Value': 'anonymous',
'Text': 'Send to anonymous'
},
{
'Value': 'brian.read',
'Text': 'Send to brian.read'
},
{
'Value': 'brian_read',
'Text': 'Send to brian_read'
},
{
'Value': 'brianr',
'Text': 'Send to brianr'
},
{
'Value': 'mailer-daemon',
'Text': 'Send to mailer-daemon'
},
{
'Value': 'postmaster',
'Text': 'Send to postmaster'
}
]
},
'Paragraph2': 'Address of internal mail server',
'Input2': {
'Type': 'Text',
'Value': '',
'Name': 'DelegateMailServer',
'Label': 'DelegateMailServer'
},
'Paragraph3': 'Address of Internet providers mail server',
'Input3': {
'Type': 'Text',
'Value': '',
'Name': 'SMTPSmartHost',
'Label': 'SMTPSmartHost'
},
'Paragraph4': 'SMTP Authentication for Internet providerDisabledEnabled',
'Input4': {
'Type': 'Select',
'Value': '',
'Name': 'SMTPAUTHPROXY_status',
'Label': 'SMTPAUTHPROXY_status',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabled',
'Text': 'Enabled'
}
]
},
'Paragraph5': 'Mail server user id',
'Input5': {
'Type': 'Text',
'Value': '',
'Name': 'SMTPAUTHPROXY_Userid',
'Label': 'SMTPAUTHPROXY_Userid'
},
'Paragraph6': 'Mail server password',
'Input6': {
'Type': 'Password',
'Value': '',
'Name': 'SMTPAUTHPROXY_Passwd',
'Label': 'SMTPAUTHPROXY_Passwd'
},
'Input7': {
'Type': 'Submit',
'Value': 'Save',
'Name': null,
'Label': null
}
}
]
}

441
json5/mai-FIL.json5 Normal file
View File

@ -0,0 +1,441 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:35:55
//
{
'PackageName': 'mai-FIL',
'prefix': 'fil',
'MenuHeading': 'Miscellaneous',
'MenuDescription': 'mai- F I L',
'MenuNavigation': '2000 400',
'firstPanel': 'PARAMS',
'signalEvent': 'smeserver-mai-fil-update',
'html': [
{
'Name': 'params',
'route': 'PARAMS',
'Header': 'E-mail settings',
'SubHeader': 'Manage mai-FIL settings:',
'Paragraph1': 'Virus scanningDisabledEnabled',
'Input1': {
'Type': 'Select',
'Value': '',
'Name': 'VirusStatus',
'Label': 'VirusStatus',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabled',
'Text': 'Enabled'
}
]
},
'Paragraph2': 'Spam filteringDisabledEnabled',
'Input2': {
'Type': 'Select',
'Value': '',
'Name': 'Spamstatus',
'Label': 'Spamstatus',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabled',
'Text': 'Enabled'
}
]
},
'Paragraph3': 'Spam sensitivityVery lowLowMediumHighVery highCustom',
'Input3': {
'Type': 'Select',
'Value': '',
'Name': 'SpamSensitivity',
'Label': 'SpamSensitivity',
'Options': [
{
'Value': 'verylow',
'Text': 'Very low'
},
{
'Value': 'low',
'Text': 'Low'
},
{
'Value': 'medium',
'Text': 'Medium'
},
{
'Value': 'high',
'Text': 'High'
},
{
'Value': 'veryhigh',
'Text': 'Very high'
},
{
'Value': 'custom',
'Text': 'Custom'
}
]
},
'Paragraph4': 'Custom spam tagging level01234567891011121314151617181920',
'Input4': {
'Type': 'Select',
'Value': '',
'Name': 'SpamTagLevel',
'Label': 'SpamTagLevel',
'Options': [
{
'Value': '0',
'Text': '0'
},
{
'Value': '1',
'Text': '1'
},
{
'Value': '2',
'Text': '2'
},
{
'Value': '3',
'Text': '3'
},
{
'Value': '4',
'Text': '4'
},
{
'Value': '5',
'Text': '5'
},
{
'Value': '6',
'Text': '6'
},
{
'Value': '7',
'Text': '7'
},
{
'Value': '8',
'Text': '8'
},
{
'Value': '9',
'Text': '9'
},
{
'Value': '10',
'Text': '10'
},
{
'Value': '11',
'Text': '11'
},
{
'Value': '12',
'Text': '12'
},
{
'Value': '13',
'Text': '13'
},
{
'Value': '14',
'Text': '14'
},
{
'Value': '15',
'Text': '15'
},
{
'Value': '16',
'Text': '16'
},
{
'Value': '17',
'Text': '17'
},
{
'Value': '18',
'Text': '18'
},
{
'Value': '19',
'Text': '19'
},
{
'Value': '20',
'Text': '20'
}
]
},
'Paragraph5': 'Custom spam rejection level01234567891011121314151617181920',
'Input5': {
'Type': 'Select',
'Value': '',
'Name': 'SpamRejectLevel',
'Label': 'SpamRejectLevel',
'Options': [
{
'Value': '0',
'Text': '0'
},
{
'Value': '1',
'Text': '1'
},
{
'Value': '2',
'Text': '2'
},
{
'Value': '3',
'Text': '3'
},
{
'Value': '4',
'Text': '4'
},
{
'Value': '5',
'Text': '5'
},
{
'Value': '6',
'Text': '6'
},
{
'Value': '7',
'Text': '7'
},
{
'Value': '8',
'Text': '8'
},
{
'Value': '9',
'Text': '9'
},
{
'Value': '10',
'Text': '10'
},
{
'Value': '11',
'Text': '11'
},
{
'Value': '12',
'Text': '12'
},
{
'Value': '13',
'Text': '13'
},
{
'Value': '14',
'Text': '14'
},
{
'Value': '15',
'Text': '15'
},
{
'Value': '16',
'Text': '16'
},
{
'Value': '17',
'Text': '17'
},
{
'Value': '18',
'Text': '18'
},
{
'Value': '19',
'Text': '19'
},
{
'Value': '20',
'Text': '20'
}
]
},
'Paragraph6': 'Sort spam into junkmail folderDisabledEnabled',
'Input6': {
'Type': 'Select',
'Value': '',
'Name': 'SpamSortSpam',
'Label': 'SpamSortSpam',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabled',
'Text': 'Enabled'
}
]
},
'Paragraph7': 'Modify subject of spam messagesDisabledEnabled',
'Input7': {
'Type': 'Select',
'Value': '',
'Name': 'SpamSubjectTag',
'Label': 'SpamSubjectTag',
'Options': [
{
'Value': 'disabled',
'Text': 'Disabled'
},
{
'Value': 'enabled',
'Text': 'Enabled'
}
]
},
'Paragraph8': 'SPAM subject prefix',
'Input8': {
'Type': 'Text',
'Value': '[SPAM]',
'Name': 'SpamSubject',
'Label': 'SpamSubject'
},
'Paragraph9': 'Content to blockPIF file (AHhIYW5k)PIF file (AHhUYXgg)PIF file (AMkgICAg)PIF file (AMlIbDk5Lm)GIF file from old virusPC executables (TVoAAAAAA)PC executables (TVoAAAEAAA)PC executables (TVoAAAQAA)PC executables (TVoAACoAG)PC executables (TVoAAD8AA)PC executables (TVoFAQUAA)PC executables (TVoIARMAA)PC executables (TVouARsAA)PC executables (TVp1AQEAAAAE)PC executables (TVpAALQAc)PC executables (TVpLRVJOR)PC executables (TVpQAAIAA)PC executables (TVpyAXkAX)PC executables (TVqQAAMAA)PC executables (TVqgAAEAAAAFAAAA)PC executables (TVrQAT8AA)PC executables (TVrhARwAk)PC executables (TVrmAU4AA)Rar archive (UmFyIRoHA)Zip archive data, at least v1.0 to extractZip archive data, at least v2.0 to extractZip archive data, variant 3Zip archive data, created on OSX',
'Input9': {
'Type': 'Select',
'Value': '',
'Name': 'BlockExecutableContent',
'Label': 'BlockExecutableContent',
'Options': [
{
'Value': 'AHhIYW5k',
'Text': 'PIF file (AHhIYW5k)'
},
{
'Value': 'AHhUYXgg',
'Text': 'PIF file (AHhUYXgg)'
},
{
'Value': 'AMkgICAg',
'Text': 'PIF file (AMkgICAg)'
},
{
'Value': 'AMlIbDk5Lm',
'Text': 'PIF file (AMlIbDk5Lm)'
},
{
'Value': 'GIF01',
'Text': 'GIF file from old virus'
},
{
'Value': 'TVoAAAAAA',
'Text': 'PC executables (TVoAAAAAA)'
},
{
'Value': 'TVoAAAEAAA',
'Text': 'PC executables (TVoAAAEAAA)'
},
{
'Value': 'TVoAAAQAA',
'Text': 'PC executables (TVoAAAQAA)'
},
{
'Value': 'TVoAACoAG',
'Text': 'PC executables (TVoAACoAG)'
},
{
'Value': 'TVoAAD8AA',
'Text': 'PC executables (TVoAAD8AA)'
},
{
'Value': 'TVoFAQUAA',
'Text': 'PC executables (TVoFAQUAA)'
},
{
'Value': 'TVoIARMAA',
'Text': 'PC executables (TVoIARMAA)'
},
{
'Value': 'TVouARsAA',
'Text': 'PC executables (TVouARsAA)'
},
{
'Value': 'TVp1AQEAAAAE',
'Text': 'PC executables (TVp1AQEAAAAE)'
},
{
'Value': 'TVpAALQAc',
'Text': 'PC executables (TVpAALQAc)'
},
{
'Value': 'TVpLRVJOR',
'Text': 'PC executables (TVpLRVJOR)'
},
{
'Value': 'TVpQAAIAA',
'Text': 'PC executables (TVpQAAIAA)'
},
{
'Value': 'TVpyAXkAX',
'Text': 'PC executables (TVpyAXkAX)'
},
{
'Value': 'TVqQAAMAA',
'Text': 'PC executables (TVqQAAMAA)'
},
{
'Value': 'TVqgAAEAAAAFAAAA',
'Text': 'PC executables (TVqgAAEAAAAFAAAA)'
},
{
'Value': 'TVrQAT8AA',
'Text': 'PC executables (TVrQAT8AA)'
},
{
'Value': 'TVrhARwAk',
'Text': 'PC executables (TVrhARwAk)'
},
{
'Value': 'TVrmAU4AA',
'Text': 'PC executables (TVrmAU4AA)'
},
{
'Value': 'UmFyIRoHA',
'Text': 'Rar archive (UmFyIRoHA)'
},
{
'Value': 'ZIPV1',
'Text': 'Zip archive data, at least v1.0 to extract'
},
{
'Value': 'ZIPV2',
'Text': 'Zip archive data, at least v2.0 to extract'
},
{
'Value': 'ZIPV3',
'Text': 'Zip archive data, variant 3'
},
{
'Value': 'ZIPVOSX',
'Text': 'Zip archive data, created on OSX'
}
]
},
'Input10': {
'Type': 'Submit',
'Value': 'Save',
'Name': null,
'Label': null
}
}
]
}

57
json5/mai-FRONT.json5 Normal file
View File

@ -0,0 +1,57 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:35:42
//
{
'PackageName': 'mai-FRONT',
'prefix': 'front',
'MenuHeading': 'Miscellaneous',
'MenuDescription': 'mai- F R O N T',
'MenuNavigation': '2000 400',
'firstPanel': 'PARAMS',
'signalEvent': 'smeserver-mai-front-update',
'html': [
{
'Name': 'params',
'route': 'PARAMS',
'Header': 'E-mail settings',
'SubHeader': 'Manage mai-FRONT settings:',
'Paragraph1': 'POP3 server accessAllow access only from local networks',
'Paragraph2': 'IMAP server accessAllow access only from local networks',
'Paragraph3': 'Webmail accessAllow HTTPS (secure)',
'Input1': {
'Type': 'Submit',
'Value': 'Modify',
'Name': null,
'Label': null
},
'Paragraph4': 'Virus scanningEnabled',
'Paragraph5': 'Spam filteringDisabled',
'Paragraph6': 'Executable content blockingDisabled',
'Input2': {
'Type': 'Submit',
'Value': 'Modify',
'Name': null,
'Label': null
},
'Paragraph7': 'E-mail retrieval modestandard',
'Paragraph8': 'SMTP port 25 allow client to authenticate:Only allow insecure access',
'Paragraph9': 'SMTPS SSL/TLS auth: port 465 status:Allow public access',
'Paragraph10': 'Submission port 587 status:Allow public access',
'Input3': {
'Type': 'Submit',
'Value': 'Modify',
'Name': null,
'Label': null
},
'Paragraph11': 'E-mail to unknown usersReject',
'Paragraph12': 'Address of internal mail server',
'Paragraph13': 'Address of Internet providers mail server',
'Input4': {
'Type': 'Submit',
'Value': 'Modify',
'Name': null,
'Label': null
}
}
]
}

254
json5/mai-REC.json5 Normal file
View File

@ -0,0 +1,254 @@
//
// Generated by sm1-html-2-json5 version:0.5 Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:36:01
//
{
'PackageName': 'mai-REC',
'prefix': 'rec',
'MenuHeading': 'Miscellaneous',
'MenuDescription': 'mai- R E C',
'MenuNavigation': '2000 400',
'firstPanel': 'PARAMS',
'signalEvent': 'smeserver-mai-rec-update',
'html': [
{
'Name': 'params',
'route': 'PARAMS',
'Header': 'E-mail settings',
'SubHeader': 'ETRN or multi-drop settings',
'Paragraph1': 'E-mail retrieval modeStandard (SMTP)ETRN (SMTP with client request)multi-drop',
'Input1': {
'Type': 'Select',
'Value': '',
'Name': 'FetchmailMethod',
'Label': 'FetchmailMethod',
'Options': [
{
'Value': 'standard',
'Text': 'Standard (SMTP)'
},
{
'Value': 'etrn',
'Text': 'ETRN (SMTP with client request)'
},
{
'Value': 'multidrop',
'Text': 'multi-drop'
}
]
},
'Paragraph2': 'SMTP port 25 allow client to authenticate:Allow SSMTP (secure)Only allow insecure accessDisabled',
'Input2': {
'Type': 'Select',
'Value': '',
'Name': 'SMTPAuth',
'Label': 'SMTPAuth',
'Options': [
{
'Value': 'publicSSL',
'Text': 'Allow SSMTP (secure)'
},
{
'Value': 'public',
'Text': 'Only allow insecure access'
},
{
'Value': 'disabled',
'Text': 'Disabled'
}
]
},
'Paragraph3': 'SMTPS SSL/TLS auth: port 465 status:Allow public accessAllow local access onlyDisabled',
'Input3': {
'Type': 'Select',
'Value': '',
'Name': 'sSMTPAuth',
'Label': 'sSMTPAuth',
'Options': [
{
'Value': 'public',
'Text': 'Allow public access'
},
{
'Value': 'local',
'Text': 'Allow local access only'
},
{
'Value': 'disabled',
'Text': 'Disabled'
}
]
},
'Paragraph4': 'Submission port 587 status:Allow public accessAllow local access onlyDisabled',
'Input4': {
'Type': 'Select',
'Value': '',
'Name': 'uSMTPAuth',
'Label': 'uSMTPAuth',
'Options': [
{
'Value': 'public',
'Text': 'Allow public access'
},
{
'Value': 'local',
'Text': 'Allow local access only'
},
{
'Value': 'disabled',
'Text': 'Disabled'
}
]
},
'Paragraph5': 'Secondary mail server',
'Input5': {
'Type': 'Text',
'Value': 'mail.myisp.xxx',
'Name': 'SecondaryMailServer',
'Label': 'SecondaryMailServer'
},
'Paragraph6': 'During office hours (8:00 AM to 6:00 PM) on weekdaysnot at allEvery 5 minutesEvery 15 minutesEvery 30 minutesEvery hourEvery 2 hours',
'Input6': {
'Type': 'Select',
'Value': '',
'Name': 'FreqOffice',
'Label': 'FreqOffice',
'Options': [
{
'Value': 'never',
'Text': 'not at all'
},
{
'Value': 'every5min',
'Text': 'Every 5 minutes'
},
{
'Value': 'every15min',
'Text': 'Every 15 minutes'
},
{
'Value': 'every30min',
'Text': 'Every 30 minutes'
},
{
'Value': 'everyhour',
'Text': 'Every hour'
},
{
'Value': 'every2hrs',
'Text': 'Every 2 hours'
}
]
},
'Paragraph7': 'Outside office hours (6:00 PM to 8:00 AM) on weekdaysnot at allEvery 5 minutesEvery 15 minutesEvery 30 minutesEvery hourEvery 2 hours',
'Input7': {
'Type': 'Select',
'Value': '',
'Name': 'FreqOutside',
'Label': 'FreqOutside',
'Options': [
{
'Value': 'never',
'Text': 'not at all'
},
{
'Value': 'every5min',
'Text': 'Every 5 minutes'
},
{
'Value': 'every15min',
'Text': 'Every 15 minutes'
},
{
'Value': 'every30min',
'Text': 'Every 30 minutes'
},
{
'Value': 'everyhour',
'Text': 'Every hour'
},
{
'Value': 'every2hrs',
'Text': 'Every 2 hours'
}
]
},
'Paragraph8': 'During the weekendnot at allEvery 5 minutesEvery 15 minutesEvery 30 minutesEvery hourEvery 2 hours',
'Input8': {
'Type': 'Select',
'Value': '',
'Name': 'FreqWeekend',
'Label': 'FreqWeekend',
'Options': [
{
'Value': 'never',
'Text': 'not at all'
},
{
'Value': 'every5min',
'Text': 'Every 5 minutes'
},
{
'Value': 'every15min',
'Text': 'Every 15 minutes'
},
{
'Value': 'every30min',
'Text': 'Every 30 minutes'
},
{
'Value': 'everyhour',
'Text': 'Every hour'
},
{
'Value': 'every2hrs',
'Text': 'Every 2 hours'
}
]
},
'Paragraph9': 'POP user account (for multi-drop)',
'Input9': {
'Type': 'Text',
'Value': 'popaccount',
'Name': 'SecondaryMailAccount',
'Label': 'SecondaryMailAccount'
},
'Paragraph10': 'POP user password (for multi-drop)',
'Input10': {
'Type': 'Password',
'Value': '',
'Name': 'SecondaryMailPassword',
'Label': 'SecondaryMailPassword'
},
'Paragraph11': 'Select sort method (for multi-drop)DefaultSpecify below',
'Input11': {
'Type': 'Select',
'Value': '',
'Name': 'SpecifyHeader',
'Label': 'SpecifyHeader',
'Options': [
{
'Value': 'off',
'Text': 'Default'
},
{
'Value': 'on',
'Text': 'Specify below'
}
]
},
'Paragraph12': 'Select sort header (for multi-drop)',
'Input12': {
'Type': 'Text',
'Value': '',
'Name': 'SecondaryMailEnvelope',
'Label': 'SecondaryMailEnvelope'
},
'Input13': {
'Type': 'Submit',
'Value': 'Save',
'Name': null,
'Label': null
}
}
]
}

58
lex_scan_py_spec_for_llm Normal file
View File

@ -0,0 +1,58 @@
I need a python program to scan for lexical strings in a set of files from a mojolicious application.
I use chevrons to enclose a meta symbol in the context of this spec.
Initially establish a parameter -p (panel)for the name of the Mojolicious panel (call it <panel>), no default, error if not supplied.
create second parameter -s (system) - call it <system>, default "SME11"
Establish logging.basicConfig.
Check <panel> is capitalised and that <system>/usr/share/smanager/lib/SrvMngr/Controller/<panel>.pm exists log error and exit otherwise.
Scan the file <system>/usr/share/smanager/lib/SrvMngr/Controller/<panel>.pm looking for my $title = $c->("<something>") or my $title = $c->('<something>') (ignore spaces).
<something> will be of the form <prefix>_<text>. <prefix> will be 2..4 alphas. Save and log the <prefix>. log Error and exit if not found.
Scanning:
<system>/usr/share/smanager/lib/SrvMngr/Controller/<panel>.pm
<system>/usr/share/smanager/themes/<default and AdminLTE>/templates/lowercase(<panel>).html.ep
<system>/usr/share/smanager/themes/<default and AdminLTE>/templates/partials/_<prefix>_<any text>.html.ep
Extract all strings of <prefix>_<some text> into a structure and save filename(s) in which it was found (may be more than one)
Deduplicate it.
Look in <system>/usr/share/smanager/lib/SrvMngr/I128N/<panel>/lowercase(<panel>)_en.lex for each of the <prefix>_<some text> found earlier and create a new file <system>/usr/share/smanager/lib/SrvMngr/I128N/<panel>/lowercase(<panel>)_en.lex.new of the corresponding lines from the .lex file that match.
For all <prefix>_<sometext> ones not found in the .lex file write them into the .new in the format '<prefix>_<sometext>' => '<sometext> with underlines mapped to spaces',
Log the number of lines in the .new file versus number of lines in the .lex file.
Read in from a JSON file (*Templates/languages.json) a list of country codes - example - {"language": "Bulgarian", "code": "bg"}
Scan <system>/usr/share/smanager/lib/SrvMngr/I128N/<panel>/lowercase(<panel>)_<language code> for all the <prefix>_<sometext> retained from above, creating the .new file from the ones found, and creating new lines:
'<prefix>_<sometext>' => '<sometext>', where <sometext> is taken from the _en.lex.new file.
As each language is done, log the number of lines in the .new file versus number of lines in the .lex file.
Rescan all
<system>/usr/share/smanager/lib/SrvMngr/Controller/<panel>.pm
<system>/usr/share/smanager/themes/<default and AdminLTE>/templates/lowercase(<panel>).html.ep
<system>/usr/share/smanager/themes/<default and AdminLTE>/templates/partials/_<prefix>_<any text>.html.ep
using the regex string pattern = r"l[\s|(][\'|\"](.*)[\'|\"]\)".
For each one found:
if it has <prefix>_ in front then discard it
Otherwise look in <system>/usr/share/smanager/lib/SrvMngr/I128N/general/general_en.lex
and if found it copy line from .lex across to <system>/usr/share/smanager/lib/SrvMngr/I128N/general/general_en.lex.new (which may already exist)
otherwise create a line in .new as follows: '<sometext>' =>'<sometext> with underline mapped to space.',
When finished, log line counts for the general .lex and .new file.
As before, Scan <system>/usr/share/smanager/lib/SrvMngr/I128N/general/general_<language code> for all the <prefix>_<sometext>, creating the .new file from the ones found in the retained ones above, and creating new lines:
'<prefix>_<sometext>' => '<sometext>', where <sometext> is taken from the _en.lex.new file.
As each language is done, log the number of lines in the .new file versus number of lines in the .lex file.
Scan the lex strings found structure, looking for ones with <prefix>_<just one word>. scan the general lex file (new one) for the <just one word>, and if not found, drop it in:
'<just one word>' => '<just one word>', and scan the general other language files for it, creating it if necessary.
edit the original file(s) in which that lexical string was found to map <prefix>_<just one word> to <just one word>
Log the number of lines per languge per general .lex and .new file.