From 6815a080d0b4a30be6352c52568504b862cad343 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Sat, 7 Sep 2024 20:57:46 +1000 Subject: [PATCH] initial commit of file from CVS for smeserver-qmail-notify on Sat Sep 7 20:57:46 AEST 2024 --- .gitignore | 4 + Makefile | 21 +++++ README.md | 16 +++- contriborbase | 1 + createlinks | 11 +++ .../defaults/qmail-notify/status | 1 + .../configuration/defaults/qmail-notify/type | 1 + .../templates/etc/crontab/qmail-notify | 19 +++++ .../lib/qmail-notify/qmail-notify-message.txt | 5 ++ smeserver-qmail-notify.spec | 79 +++++++++++++++++++ 10 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 contriborbase create mode 100755 createlinks create mode 100644 root/etc/e-smith/db/configuration/defaults/qmail-notify/status create mode 100644 root/etc/e-smith/db/configuration/defaults/qmail-notify/type create mode 100644 root/etc/e-smith/templates/etc/crontab/qmail-notify create mode 100644 root/usr/local/lib/qmail-notify/qmail-notify-message.txt create mode 100644 smeserver-qmail-notify.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..892d7b1 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-qmail-notify +# $Id: Makefile,v 1.1 2021/04/09 22:29:44 jcrisp Exp $ +NAME := smeserver-qmail-notify +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 3fee95c..6ac75d1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ -# smeserver-qmail-notify +# smeserver-qmail-notify -SMEServer Koozali developed git repo for smeserver-qmail-notify smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-qmail-notify smecontribs + +## Wiki +
https://wiki.koozali.org/Qmail-notify + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-qmail-notify&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 100755 index 0000000..1038923 --- /dev/null +++ b/createlinks @@ -0,0 +1,11 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +foreach $file ( + qw( /etc/crontab )) +{ + templates2events($file, qw(bootstrap-console-save email-update smeserver-qmail-notify-update)); +} + +exit 0 diff --git a/root/etc/e-smith/db/configuration/defaults/qmail-notify/status b/root/etc/e-smith/db/configuration/defaults/qmail-notify/status new file mode 100644 index 0000000..26ed6c9 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/qmail-notify/status @@ -0,0 +1 @@ +enabled \ No newline at end of file diff --git a/root/etc/e-smith/db/configuration/defaults/qmail-notify/type b/root/etc/e-smith/db/configuration/defaults/qmail-notify/type new file mode 100644 index 0000000..641e525 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/qmail-notify/type @@ -0,0 +1 @@ +configuration \ No newline at end of file diff --git a/root/etc/e-smith/templates/etc/crontab/qmail-notify b/root/etc/e-smith/templates/etc/crontab/qmail-notify new file mode 100644 index 0000000..da86559 --- /dev/null +++ b/root/etc/e-smith/templates/etc/crontab/qmail-notify @@ -0,0 +1,19 @@ +{ + use strict; + use warnings; + use esmith::ConfigDB; + + my $configDB = esmith::ConfigDB->open_ro or die("can't open Config DB"); + my $dbKey = 'qmail-notify'; + my $status = $configDB->get_prop( $dbKey, 'status' ) || 'disabled'; + my $minutes = $configDB->get_prop( $dbKey, 'minutes' ) || '30'; + my $hours = $configDB->get_prop( $dbKey, 'hours' ) || '*'; + my $file = $configDB->get_prop( $dbKey, 'filename' ) || 'qmail-notify-message.txt'; + + if ( $status eq 'enabled' ) { + $OUT .= "# run qmail-notify\n"; + $OUT .= "$minutes $hours * * * root /usr/bin/qmail-notify -r -f /usr/local/lib/qmail-notify/$file\n"; + $OUT .= "\n"; + } +} + diff --git a/root/usr/local/lib/qmail-notify/qmail-notify-message.txt b/root/usr/local/lib/qmail-notify/qmail-notify-message.txt new file mode 100644 index 0000000..35b303d --- /dev/null +++ b/root/usr/local/lib/qmail-notify/qmail-notify-message.txt @@ -0,0 +1,5 @@ +Your message has been received by %s but has been +undeliverable to the following recipients for at least %s. +The mail system will continue to attempt to deliver your message +to these recipients for a total of %s. You do not need to +resend your message at this time. diff --git a/smeserver-qmail-notify.spec b/smeserver-qmail-notify.spec new file mode 100644 index 0000000..da895ec --- /dev/null +++ b/smeserver-qmail-notify.spec @@ -0,0 +1,79 @@ +Summary: notify senders about email that has been held in the qmail queue +%define name smeserver-qmail-notify +Name: %{name} +%define version 2.0.0 +%define release 5 +Version: %{version} +Release: %{release} +License: GPLv2+ +Group: Networking/Info +Source: %{name}-%{version}.tar.xz +Packager: Peter Schubert +URL: http://www.saco-support.de/SME +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +BuildRequires: e-smith-devtools +Requires: e-smith-base +Requires: e-smith-lib +Requires: perl +Requires: qmail-notify + +AutoReqProv: no +%description +This package provides templates for a program to notify senders +about email that has been held in the qmail queue + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 2.0.0-5.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Mon Sep 27 2021 Brian Read 2.0.0-4.sme +- Fix up createlinks to create update event [SME: 11542 ] + +* Mon Sep 27 2021 John Crisp 2.0.0-3.sme +- Fix timing in cron template - Zsolt Vasarhelyi [SME: 11542] + +* Thu Sep 23 2021 John Crisp 2.0.0-2.sme +- Fix typo in cron template - Zsolt Vasarhelyi [SME:11542] + +* Fri Apr 09 2021 John Crisp 2.0.0-1.sme +- First Import to SME Contribs [SME: 11542] +- Template crontab +- DB configuration enabled, hours, nminutes, alt filename + +* Thu Aug 29 2002 Peter Schubert 1.0.0-01 +- First release + +%prep + +%setup + +%build + +perl createlinks + +rm -rf $RPM_BUILD_ROOT + +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +rm -f e-smith-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist + +%defattr(-,root,root) + +%pre + +%post +/sbin/e-smith/expand-template /etc/crontab + +%preun + +%postun