* [git.ipfire.org] IPFire 3.x development tree branch, master, updated. 0abdfe9f201646d56c1150ea8604f3daf5c9d585
@ 2015-11-12 0:29 git
0 siblings, 0 replies; only message in thread
From: git @ 2015-11-12 0:29 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 8615 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 3.x development tree".
The branch, master has been updated
via 0abdfe9f201646d56c1150ea8604f3daf5c9d585 (commit)
from 1c6d545816cd0ad5117bde16b8d78b4368c072d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0abdfe9f201646d56c1150ea8604f3daf5c9d585
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Thu Nov 12 00:25:50 2015 +0000
dma: New package
Fixes #10953
Fixes #10954
The dma-queue-flush.timer will execute the corresponding service
file every hour to call dma and send out all mails. The
dma-cleanup-spool.timer is used to periodly call the service
file for cleaning up the DMA spooler directory.
Both timer files will be enabled during installation of the dma package.
Fixes #10955
This dma-cleanup-spool script cleans up the spool directory from
DMA mail service after defined period of time. Otherwise the spool
dir may be flooded.
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
Signed-off-by: Alexander Marx <alexander.marx(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
openssh/sshd-keygen => dma/dma-cleanup-spool | 39 +++++++--------
dma/dma.nm | 75 ++++++++++++++++++++++++++++
dma/systemd/dma-cleanup-spool.service | 5 ++
dma/systemd/dma-cleanup-spool.timer | 9 ++++
dma/systemd/dma-queue-flush.service | 10 ++++
dma/systemd/dma-queue-flush.timer | 9 ++++
6 files changed, 127 insertions(+), 20 deletions(-)
copy openssh/sshd-keygen => dma/dma-cleanup-spool (73%)
create mode 100644 dma/dma.nm
create mode 100644 dma/systemd/dma-cleanup-spool.service
create mode 100644 dma/systemd/dma-cleanup-spool.timer
create mode 100644 dma/systemd/dma-queue-flush.service
create mode 100644 dma/systemd/dma-queue-flush.timer
Difference in files:
diff --git a/dma/dma-cleanup-spool b/dma/dma-cleanup-spool
new file mode 100644
index 0000000..92af30c
--- /dev/null
+++ b/dma/dma-cleanup-spool
@@ -0,0 +1,48 @@
+#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2015 Michael Tremer <michael.tremer(a)ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+SPOOL_DIR="/var/spool/dma"
+
+find_messages() {
+ find "${SPOOL_DIR}" -type f -name "M*" -mtime +30
+}
+
+remove_message() {
+ local f_message="${1}"
+ local f_queue="${f_message/${SPOOL_DIR}\/M/${SPOOL_DIR}\/Q}"
+
+ # If a message file and a queue file exist, delete both
+ [ -f "${f_message}" ] || return 1
+ [ -f "${f_queue}" ] || return 1
+
+ rm -f "${f_message}" "${f_queue}"
+ return 0
+}
+
+main() {
+ for message in $(find_messages); do
+ remove_message "${message}"
+ done
+
+ return 0
+}
+
+main || exit $?
diff --git a/dma/dma.nm b/dma/dma.nm
new file mode 100644
index 0000000..259421a
--- /dev/null
+++ b/dma/dma.nm
@@ -0,0 +1,75 @@
+###############################################################################
+# IPFire.org - An Open Source Firewall Solution #
+# Copyright (C) - IPFire Development Team <info(a)ipfire.org> #
+###############################################################################
+
+name = dma
+version = 0.10
+release = 1
+
+groups = Mail
+url = https://github.com/corecode/dma
+license = BSD
+summary = DragonFly Mail Agent
+
+description
+ dma is a small Mail Transport Agent (MTA), designed for home and
+ office use. It accepts mails from locally installed Mail User Agents
+ (MUA) and delivers the mails either locally or to a remote destination.
+
+ Remote delivery includes several features like TLS/SSL support and
+ SMTP authentication.
+end
+
+build
+ requires
+ bison
+ flex
+ openssl-devel
+ end
+
+ make_build_targets += PREFIX=%{prefix}
+
+ # Workaround for #10952
+ make_build_targets += LEX="flex -l"
+
+ make_install_targets += PREFIX=%{prefix} \
+ sendmail-link mailq-link install-spool-dirs install-etc
+
+ install_cmds
+ install -m 755 %{DIR_SOURCE}/dma-cleanup-spool %{BUILDROOT}%{sbindir}
+ end
+end
+
+packages
+ package %{name}
+ groups += Base
+
+ script postin
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ systemctl --no-reload enable dma-queue-flush.timer >/dev/null 2>&1 || :
+ systemctl --no-reload enable dma-cleanup-spool.timer >/dev/null 2>&1 || :
+ end
+
+ script preun
+ systemctl --no-reload disable dma-queue-flush.timer >/dev/null 2>&1 || :
+ systemctl --no-reload disable dma-cleanup-spool.timer >/dev/null 2>&1 || :
+ systemctl stop dma-queue-flush.timer >/dev/null 2>&1 || :
+ systemctl stop dma-cleanup-spool.timer >/dev/null 2>&1 || :
+ systemctl stop dma-queue-flush.service >/dev/null 2>&1 || :
+ systemctl stop dma-cleanup-spool.service >/dev/null 2>&1 || :
+ end
+
+ script postun
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ end
+
+ script postup
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ end
+ end
+
+ package %{name}-debuginfo
+ template DEBUGINFO
+ end
+end
diff --git a/dma/systemd/dma-cleanup-spool.service b/dma/systemd/dma-cleanup-spool.service
new file mode 100644
index 0000000..96b5770
--- /dev/null
+++ b/dma/systemd/dma-cleanup-spool.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Cleanup of the DMA mail spool directory
+
+[Service]
+ExecStart=/usr/sbin/dma-cleanup-spool
diff --git a/dma/systemd/dma-cleanup-spool.timer b/dma/systemd/dma-cleanup-spool.timer
new file mode 100644
index 0000000..57cd716
--- /dev/null
+++ b/dma/systemd/dma-cleanup-spool.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Periodly cleanup of the DMA mail spool directory
+
+[Timer]
+OnCalendar=weekly
+Persistent=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dma/systemd/dma-queue-flush.service b/dma/systemd/dma-queue-flush.service
new file mode 100644
index 0000000..9b48045
--- /dev/null
+++ b/dma/systemd/dma-queue-flush.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Flushing of the DMA mail queue.
+After=network-online.target
+Requires=network-online.target
+Wants=network-online.target
+
+[Service]
+SendSIGKILL=false
+TimeoutStopSec=0
+ExecStart=/usr/sbin/dma -q
diff --git a/dma/systemd/dma-queue-flush.timer b/dma/systemd/dma-queue-flush.timer
new file mode 100644
index 0000000..efa1728
--- /dev/null
+++ b/dma/systemd/dma-queue-flush.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Periodly flushing of the DMA mail queue.
+
+[Timer]
+OnCalendar=hourly
+Persistent=true
+
+[Install]
+WantedBy=multi-user.target
hooks/post-receive
--
IPFire 3.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-12 0:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 0:29 [git.ipfire.org] IPFire 3.x development tree branch, master, updated. 0abdfe9f201646d56c1150ea8604f3daf5c9d585 git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox