diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3aa8108
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.rpm
+*.log
+*spec-20*
+*.tgz
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..45f3f86
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+# Makefile for source rpm: smeserver-qmHandle
+# $Id: Makefile,v 1.1 2020/10/13 11:53:27 brianr Exp $
+NAME := smeserver-qmHandle
+SPECFILE = $(firstword $(wildcard *.spec))
+
+define find-makefile-common
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+endef
+
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
+
+ifeq ($(MAKEFILE_COMMON),)
+# attept a checkout
+define checkout-makefile-common
+test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+endef
+
+MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
+endif
+
+include $(MAKEFILE_COMMON)
diff --git a/README.md b/README.md
index 773e0a5..978d56b 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,15 @@
-# smeserver-qmHandle
+# smeserver-qmHandle
-SMEServer Koozali developed git repo for smeserver-qmHandle smecontribs
\ No newline at end of file
+SMEServer Koozali developed git repo for smeserver-qmHandle smecontribs
+
+## Wiki
+
https://wiki.koozali.org/Qmhandle_mail_queue_manager
+
+## Bugzilla
+Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-qmHandle&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
+
+## Description
+
+
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
+*Once it has been checked, then this comment will be deleted*
+
diff --git a/contriborbase b/contriborbase
new file mode 100644
index 0000000..9b7fd51
--- /dev/null
+++ b/contriborbase
@@ -0,0 +1 @@
+contribs10
diff --git a/createlinks b/createlinks
new file mode 100644
index 0000000..17e56e1
--- /dev/null
+++ b/createlinks
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+# This script creates the symlinks needed by this RPM
+# Specific support exists to create symlinks within e-smith web "panels"
+# and for links from named "events" directories into the "actions" directory
+use esmith::Build::CreateLinks qw(:all);
+
+
+#--------------------------------------------------
+# functions for manager panel
+#--------------------------------------------------
+my $panel = "manager";
+
+panel_link("qmh", $panel);
+
+#--------------------------------------------------
+# actions for console-save event:
+#--------------------------------------------------
+
+#--------------------------------------------------
+# actions for smeserver-qmHandle-update event:
+#--------------------------------------------------
+
+my $event = 'smeserver-qmHandle-update';
+
+safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager");
+
+event_link('navigation2-conf', "$event", '80');
+event_link('routes2-conf', "$event", '80');
+event_link('locales2-conf', "$event", '80');
+
+#--------------------------------------------------
+# The End
+#--------------------------------------------------
diff --git a/root/etc/e-smith/events/smeserver-qmHandle-update/.gitignore b/root/etc/e-smith/events/smeserver-qmHandle-update/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/root/etc/e-smith/locale/bg/etc/e-smith/web/functions/qmh b/root/etc/e-smith/locale/bg/etc/e-smith/web/functions/qmh
new file mode 100644
index 0000000..ff0ed5d
--- /dev/null
+++ b/root/etc/e-smith/locale/bg/etc/e-smith/web/functions/qmh
@@ -0,0 +1,95 @@
+
"; + $out .= "$MailQueues"; + $out .= sprintf ""; + $out .= sprintf ""; + return $out; +} + + +#------------------------------------------------------------ +# subroutine to showListLocalQueue +#------------------------------------------------------------ +sub showListLocalQueue { + + my ($c, $altq) = @_; + + my $out = ''; + my $reporttype = 'list-local-queue'; + + my $opt = ($altq ? 'altqmail: ' : ''); + $out .= sprintf("
"; + $out .= "$LocalQueue"; + $out .= sprintf ""; + $out .= sprintf ""; + return $out; +} + + +#------------------------------------------------------------ +# subroutine to showListRemoteQueue +#------------------------------------------------------------ +sub showListRemoteQueue { + + my ($c, $altq) = @_; + + my $out = ''; + my $reporttype = 'list-remote-queue'; + + my $opt = ($altq ? 'altqmail: ' : ''); + $out .= sprintf("
"; + $out .= "$RemoteQueue"; + $out .= sprintf ""; + $out .= sprintf ""; + return $out; +} + + +#------------------------------------------------------------ +# subroutine to send ALARM to qmail +#------------------------------------------------------------ +sub resend { + + my ($c, $altq) = @_; + + my $out = ''; + my $reporttype = 'resend'; + + my $opt = ($altq ? 'altqmail: ' : ''); + $out .= sprintf("
"; + $out .= "$Res"; + $out .= sprintf ""; + $out .= sprintf ""; + $out .= sprintf "
"; + $out .= ""; + $out .= sprintf ""; + $out .= sprintf ""; + return $out; +} + + +sub deleteMessageNumber { + + my ($c, $msgid, $altq, $reporttype) = @_; + + if ($msgid =~ /^(\d+)$/) { + $msgid = $1; + } else { + $msgid = undef; + } + + my $out = ''; + my $opt = ($altq ? "-X -d$msgid" : "-d$msgid"); + my $Output = `/usr/bin/qmHandle $opt`; + + $out .= sprintf "
"; + $out .= "$Output"; + $out .= sprintf ""; + $out .= sprintf ""; + return $out; + +} + + +1; diff --git a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_en.lex b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_en.lex new file mode 100644 index 0000000..40adc2d --- /dev/null +++ b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_en.lex @@ -0,0 +1,21 @@ +'qmh_QMH_TITLE' => 'Qmail queue management', +'qmh_OPERATION_STATUS_REPORT' => 'Operation status report', +'qmh_QMH_DESC' => 'This panel uses qmHandle to manage the qmail message queues. Key features are the ability to view and delete messages in the queues.', +'qmh_TRY_SEND_QUEUE' => 'Force resending of the Qmail queue', +'qmh_SEND_QUEUE_AT' => 'Resend Qmail queue at: ', +'qmh_LIST_QUEUE' => 'List message queues', +'qmh_LIST_LOCAL_QUEUE' => 'List local message queue', +'qmh_SHOWLISTQUEUES' => 'List Qmail local and remote queues', +'qmh_LIST_REMOTE_QUEUE' => 'List remote message queue', +'qmh_VIEW_TIME' => 'Qmail message queue, viewed at: ', +'qmh_LIST_LOCAL_QUEUE' => 'List Qmail local queue', +'qmh_LIST_REMOTE_QUEUE' => 'List Qmail remote queue', +'qmh_RESEND_QUEUE' => 'Try to send queued messages now (qmail must be running)', +'qmh_DELETE_MSG_TITLEB' => 'Queue management: delete Message', +'qmh_DELETE_MESSAGE' => 'Delete this message from the queue ? (Only the first 100 lines are listed)', +'qmh_DELETE' => 'Delete', +'qmh_SELECT_AN_ACTION' => 'Select an action', +'qmh_iFROM_QUEUE' => 'from message queue', +'qmh_RETURN_TO_QUEUE' => 'Return to Queue', +'qmh_Administration' => 'Administration', +'E-mail Warteschlange' => 'E-Mail queue management', diff --git a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_fr.lex b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_fr.lex new file mode 100644 index 0000000..beedc95 --- /dev/null +++ b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Qmh/qmh_fr.lex @@ -0,0 +1,21 @@ +'qmh_QMH_TITLE' => 'Administration de file d\'attente', +'qmh_OPERATION_STATUS_REPORT' => 'Rapport d\'état de l\'opération', +'qmh_QMH_DESC' => 'Ce panel utilise qmHandle pour administrer la file d\'attente de Qmail. Les fonctionnalités principales sont de voir et d\'effacer des messages dans la file d\'attente. ', +'qmh_TRY_SEND_QUEUE' => 'Forcer le renvoi de la file d\'attente de qmail', +'qmh_SEND_QUEUE_AT' => 'Renvoi la file d\'attente Qmail le : ', +'qmh_LIST_QUEUE' => 'Message de la file d\'attente', +'qmh_LIST_LOCAL_QUEUE' => 'File d\'attente locale', +'qmh_SHOWLISTQUEUES' => 'Files d\'attente locale et distante', +'qmh_LIST_REMOTE_QUEUE' => 'File d\'attente distante de QMAIL', +'qmh_VIEW_TIME' => 'La file d\'attente des messages de Qmail le : ', +'qmh_LIST_LOCAL_QUEUE' => 'File d\'attente locale de QMAIL', +'qmh_LIST_REMOTE_QUEUE' => 'File d\'attente distante de QMAIL', +'qmh_RESEND_QUEUE' => 'Renvoyer les messages de la file d\'attente maintenant (Qmail doit être en fonction)', +'qmh_DELETE_MSG_TITLEB' => 'Administration de file d\'attente : effacer le Message', +'qmh_DELETE_MESSAGE' => 'Effacez ce message de la file d\'attente? (Seulement les 100 premières lignes sont affichées)', +'qmh_DELETE' => 'Supprimer', +'qmh_SELECT_AN_ACTION' => 'Sélectionnez une action :', +'qmh_iFROM_QUEUE' => 'de la file d\'attente des messages', +'qmh_RETURN_TO_QUEUE' => 'Retour à la file d\'attente', +'qmh_Administration' => 'Administration', +'E-mail Warteschlange' => 'Administration de file d\'attente des courriels', diff --git a/root/usr/share/smanager/themes/default/templates/qmh.html.ep b/root/usr/share/smanager/themes/default/templates/qmh.html.ep new file mode 100644 index 0000000..fcfa379 --- /dev/null +++ b/root/usr/share/smanager/themes/default/templates/qmh.html.ep @@ -0,0 +1,56 @@ +% layout 'default', title => "Sme server 2 - qmh"; + +% content_for 'module' => begin +
+ %= dumper $c->current_route + %= dumper $qmh_datas +
+ %} + % if ( stash 'error' ) { ++ + %=l 'qmh_SELECT_AN_ACTION' + + + %= select_field 'Report_type' => $c->reportType_list() + +
+ %} + % if ($qmh_datas->{trt} eq 'REP') { + % $btn = l('NEXT'); + %= $c->render_to_string( inline => stash 'modul' ) + %} + % if ($qmh_datas->{trt} eq 'DEL') { + % $btn = l('qmh_RETURN_TO_QUEUE'); + %= $c->render_to_string( inline => stash 'modul' ) + %= hidden_field 'msgid' => $qmh_datas->{msgid} + % $qmh_datas->{trt} = 'LST'; + %} + % if ($qmh_datas->{trt} eq 'MSG') { + % $btn = l('Delete'); + %= $c->render_to_string( inline => stash 'modul' ) + %= hidden_field 'msgid' => $qmh_datas->{msgid} + % $qmh_datas->{trt} = 'DEL'; + %} +