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 2.x development tree".
The branch, next has been updated via 18f4c007f132fa809eea7a2bedebb701ac705b84 (commit) via 08ebd823bb3e165454394313b59120c96142954a (commit) via dbe1e1137f263957516815f3ce2e027c7fc9838e (commit) via 883c5453d9aaeb3da2fbe879bc024c161d00ba21 (commit) from 7577ec1eb17f727e6397b1e6457c05dfef0c3371 (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 18f4c007f132fa809eea7a2bedebb701ac705b84 Author: Lars Schuhmacher larsen007@web.de Date: Sat Aug 22 23:11:19 2015 +0200
fix typo in ipsec.user.secrets
Fixes a little typo
Signed-off-by: Lars Schuhmacher larsen007@web.de Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit 08ebd823bb3e165454394313b59120c96142954a Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Aug 25 22:03:25 2015 +0100
dma: Add cron job to clean up spool directory
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit dbe1e1137f263957516815f3ce2e027c7fc9838e Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Aug 25 22:02:31 2015 +0100
dma: Add script that cleans up stale emails in the spool directory
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit 883c5453d9aaeb3da2fbe879bc024c161d00ba21 Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Aug 25 21:55:40 2015 +0100
network-functions: Add check_subnet()
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: config/cfgroot/network-functions.pl | 15 +++++++++ config/cron/crontab | 6 ++++ .../dma/dma-cleanup-spool | 39 +++++++++++----------- config/etc/ipsec.user.secrets | 2 +- config/rootfiles/common/dma | 1 + config/rootfiles/core/94/filelists/files | 1 + config/rootfiles/core/94/update.sh | 3 ++ lfs/dma | 1 + 8 files changed, 48 insertions(+), 20 deletions(-) copy tools/sort_strings.pl => config/dma/dma-cleanup-spool (72%) mode change 100755 => 100644
Difference in files: diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index 1cd2814..9dd752d 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -163,6 +163,21 @@ sub check_ip_address_and_netmask($$) { return &check_netmask($netmask); }
+# Returns True for all valid subnets like a.b.c.d/e or a.b.c.d/a.b.c.d +sub check_subnet($) { + my $subnet = shift; + + my ($address, $network) = split(///, $subnet, 2); + + # Check if the IP address is fine. + my $result = &check_ip_address($address); + unless ($result) { + return $result; + } + + return &check_prefix($network) || &check_netmask($network); +} + # For internal use only. Will take an IP address and # return it in a normalised style. Like 8.8.8.010 -> 8.8.8.8. sub _normalise_ip_address($) { diff --git a/config/cron/crontab b/config/cron/crontab index 9ba5245..02abadc 100644 --- a/config/cron/crontab +++ b/config/cron/crontab @@ -58,3 +58,9 @@ HOME=/
# Update GeoIP database once a month. %monthly,random * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/xt_geoip_update >/dev/null 2>&1 + +# Retry sending spooled mails regularly +%hourly * /usr/sbin/dma -q + +# Cleanup the mail spool directory +%weekly * * /usr/sbin/dma-cleanup-spool diff --git a/config/dma/dma-cleanup-spool b/config/dma/dma-cleanup-spool new file mode 100644 index 0000000..92af30c --- /dev/null +++ b/config/dma/dma-cleanup-spool @@ -0,0 +1,48 @@ +#!/bin/bash +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2015 Michael Tremer michael.tremer@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/config/etc/ipsec.user.secrets b/config/etc/ipsec.user.secrets index 0e0858a..7bc066f 100644 --- a/config/etc/ipsec.user.secrets +++ b/config/etc/ipsec.user.secrets @@ -1,2 +1,2 @@ -# user secrets that should not overwritten by the webif +# user secrets that should not be overwritten by the webif # diff --git a/config/rootfiles/common/dma b/config/rootfiles/common/dma index 24c365d..ac57527 100644 --- a/config/rootfiles/common/dma +++ b/config/rootfiles/common/dma @@ -1,6 +1,7 @@ etc/alternatives/sendmail usr/lib/dma-mbox-create usr/sbin/dma +usr/sbin/dma-cleanup-spool usr/sbin/mailq usr/sbin/sendmail usr/sbin/sendmail.dma diff --git a/config/rootfiles/core/94/filelists/files b/config/rootfiles/core/94/filelists/files index a603603..d62794d 100644 --- a/config/rootfiles/core/94/filelists/files +++ b/config/rootfiles/core/94/filelists/files @@ -5,3 +5,4 @@ srv/web/ipfire/cgi-bin/logs.cgi/log.dat srv/web/ipfire/cgi-bin/mail.cgi var/ipfire/langs var/ipfire/menu/40-services.menu +var/ipfire/network-functions.pl diff --git a/config/rootfiles/core/94/update.sh b/config/rootfiles/core/94/update.sh index d820b11..5fb0936 100644 --- a/config/rootfiles/core/94/update.sh +++ b/config/rootfiles/core/94/update.sh @@ -59,6 +59,9 @@ grep -qv "dma -q" || cat <<EOF >> /var/spool/cron/root.orig
# Retry sending spooled mails regularly %hourly * /usr/sbin/dma -q + +# Cleanup the mail spool directory +%weekly * * /usr/sbin/dma-cleanup-spool EOF
fcrontab -z &>/dev/null diff --git a/lfs/dma b/lfs/dma index 4e6150e..9fe49ab 100644 --- a/lfs/dma +++ b/lfs/dma @@ -78,6 +78,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && sed -i '/CONFDIR/s/etc/dma/var/ipfire/dma/g' Makefile cd $(DIR_APP) && make cd $(DIR_APP) && make install mailq-link install-spool-dirs install-etc + install -v -m 755 $(DIR_SRC)/config/dma/dma-cleanup-spool /usr/sbin chown -R nobody.nobody /var/ipfire/dma chown nobody.root /var/ipfire/dma/auth.conf ln -svf dma /usr/sbin/sendmail.dma
hooks/post-receive -- IPFire 2.x development tree