--- mailping-0.0.4ubuntu5+really0.0.4.orig/MailPing/fileutil.py +++ mailping-0.0.4ubuntu5+really0.0.4/MailPing/fileutil.py @@ -1,4 +1,4 @@ -import os, errno, time, socket +import os, errno, time, socket, shutil HOSTNAME = socket.gethostname().replace('/', r'\057').replace(':', r'\072') PID = os.getpid() @@ -26,4 +26,4 @@ f = file(temp, 'w') f.write(content) f.close() - os.rename(temp, path) + shutil.move(temp, path) --- mailping-0.0.4ubuntu5+really0.0.4.orig/MailPing/incoming.py +++ mailping-0.0.4ubuntu5+really0.0.4/MailPing/incoming.py @@ -1,31 +1,31 @@ -import os +import os, shutil from MailPing import mail, maildir, fileutil def process(statedir): def _processEmail(subdir, filename): ident = mail.getID(os.path.join(subdir, filename)) if ident is None: - maildir.create(os.path.join(subdir, '..', '..', 'junk')) - os.rename(os.path.join(subdir, filename), - os.path.join(subdir, '..', '..', 'junk', 'new', filename)) + maildir.create(os.path.normpath(os.path.join(subdir, '..', '..', 'junk'))) + shutil.move(os.path.join(subdir, filename), + os.path.normpath(os.path.join(subdir, '..', '..', 'junk', 'new', filename))) else: - pending = os.path.join(subdir, + pending = os.path.normpath(os.path.join(subdir, '..', '..', - 'pending', ident) + 'pending', ident)) timestamp = fileutil.getTime(pending) if timestamp < 0: - maildir.create(os.path.join(subdir, '..', '..', 'broken')) - os.rename(os.path.join(subdir, filename), - os.path.join(subdir, '..', '..', 'broken', 'new', filename)) + maildir.create(os.path.normpath(os.path.join(subdir, '..', '..', 'broken'))) + shutil.move(os.path.join(subdir, filename), + os.path.normpath(os.path.join(subdir, '..', '..', 'broken', 'new', filename))) else: - lastSuccess = fileutil.getTime(os.path.join(subdir, + lastSuccess = fileutil.getTime(os.path.normpath(os.path.join(subdir, '..', '..', - 'success')) + 'success'))) if timestamp > lastSuccess: - os.rename(os.path.join(subdir, filename), - os.path.join(subdir, '..', '..', 'success.msg')) - os.rename(pending, - os.path.join(subdir, '..', '..', 'success')) + shutil.move(os.path.join(subdir, filename), + os.path.normpath(os.path.join(subdir, '..', '..', 'success.msg'))) + shutil.move(pending, + os.path.normpath(os.path.join(subdir, '..', '..', 'success'))) deliveryTime = maildir.getTimeFromFilename(filename) if isinstance(deliveryTime, int): @@ -39,7 +39,7 @@ # to do probe sending before incoming processing. timestamp = int(timestamp) if deliveryTime is not None and deliveryTime >= timestamp: - fileutil.writeFile(os.path.join(subdir, '..', '..', 'latency'), + fileutil.writeFile(os.path.normpath(os.path.join(subdir, '..', '..', 'latency')), '%f\n' % (deliveryTime - timestamp)) else: os.unlink(os.path.join(subdir, filename)) --- mailping-0.0.4ubuntu5+really0.0.4.orig/MailPing/maildir.py +++ mailping-0.0.4ubuntu5+really0.0.4/MailPing/maildir.py @@ -64,7 +64,7 @@ except ValueError: pass else: - return float(seconds + microseconds * 1e-6) + return string.atof("%s.%s" % (seconds, microseconds)) return int(seconds) --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/changelog +++ mailping-0.0.4ubuntu5+really0.0.4/debian/changelog @@ -0,0 +1,171 @@ +mailping (0.0.4ubuntu5+really0.0.4-3ubuntu1) xenial; urgency=medium + + * Fake sync from Debian due to version issue. + + -- Graham Inggs Sun, 17 Jan 2016 18:22:22 +0200 + +mailping (0.0.4-3) unstable; urgency=medium + + * Orphan package. + * Switch from python-support to dh_python2. + * Update to debhelper 9 and policy 3.9.6. + * Add ${misc:depends} and correct build targets. + + -- Thijs Kinkhorst Fri, 01 May 2015 14:00:51 +0000 + +mailping (0.0.4ubuntu5+really0.0.4-2ubuntu1) karmic; urgency=low + + * Fake sync from Debian due to version issue. (LP: #223596) + + -- Miguel Ruiz Wed, 16 Sep 2009 00:16:05 -0400 + +mailping (0.0.4-2) unstable; urgency=low + + * Adopt package (Closes: #440618). + * Use shutil.move instead of rename, in case the source mailbox is + on another filesystem. + * Canonicalize used paths, to prevent problems that some Python + modules have with paths containing "../..". + * Improve microseconds calculation in latency (closes: #457407), + thanks Andrew Garner for the patch. + * Denatify (closes: #453701). + * Switch from cdbs to debhelper. + * Ship Maildir in this package instead of creating it in postinst, + be more thorough on cleanup when purging package (closes: #454715). + * Update to debhelper version 6. + * Checked for policy 3.7.3, no changes. + * Fix part of manpage formatting. + * No longer remove 'mailping' user on package remove, since this + is controversial. + + -- Thijs Kinkhorst Tue, 15 Jan 2008 22:08:46 +0100 + +mailping (0.0.4ubuntu5) hardy; urgency=low + + * Merge from debian unstable 0.0.4-1 (LP: #175998), remaining changes: + + debian/rules + - Keep DEB_PYTHON_SYSTEM defined. + + debian/control + - Updated Maintainer value to match Debian-Maintainer-Field Spec. + + -- Miguel Ruiz Fri, 14 Dec 2007 14:52:41 -0300 + +mailping (0.0.4-1) unstable; urgency=low + + * QA upload. (ACK NMU; Closes: #380863) + * Set maintainer to QA Group; Orphaned: #440618 + * Update debian/copyright + + -- Michael Ablassmeier Mon, 24 Sep 2007 09:46:25 +0200 + +mailping (0.0.4ubuntu4) gutsy; urgency=low + + * The "supposed to be 0.0.4-0.2ubuntu1" release. + * Merge from debian unstable, remaining changes: + - debian/rules: keep DEB_PYTHON_SYSTEM defined. + + -- Zak B. Elep Tue, 12 Jun 2007 13:02:48 +0000 + +mailping (0.0.4-0.2) unstable; urgency=high + + * Non-maintainer upload during BSP. + * Fix non-conditional use of userdel in postrm (Closes: #417020). + * Add depends on adduser as it is used in postinst. + + -- Luk Claes Thu, 17 May 2007 01:04:08 +0200 + +mailping (0.0.4ubuntu3) feisty; urgency=low + + * The "is this supposed to be 0.0.4-0.1ubuntu1?" release. + * debian/control, debian/rules: + + Update to work with new Python policy from Debian. + + -- Zak B. Elep Wed, 15 Nov 2006 17:25:18 +0800 + +mailping (0.0.4ubuntu2) edgy; urgency=low + + * Fake-syncing from debian unstable due to version number. No ubuntu changes + + -- Sarah Hobbs Wed, 30 Aug 2006 12:31:53 +1000 + +mailping (0.0.4-0.1) unstable; urgency=low + + * Non-maintainer upload. + * Bump Standards-Version to 3.7.2. + * Update package to the last python policy (Closes: #380863). + * Move some things into B-D instead of B-D-I. + + -- Pierre Habouzit Sat, 12 Aug 2006 13:45:40 +0200 + +mailping (0.0.4ubuntu1) hoary; urgency=low + + * Rebuild for python2.4. + + -- Matthias Klose Sun, 3 Apr 2005 21:01:33 +0200 + +mailping (0.0.4) unstable; urgency=low + + * Skip temporary files when processing the pending directory. + * Fix a typo in the probe message. + * Switch section from devel to mail. + + -- Tommi Virtanen Mon, 13 Dec 2004 22:07:45 +0200 + +mailping (0.0.3) unstable; urgency=low + + * Build-depend on python-dev, not python2.3-dev. (Closes: #259130) + + -- Tommi Virtanen Tue, 13 Jul 2004 15:39:16 +0300 + +mailping (0.0.2) unstable; urgency=low + + * Incompatible changes: + - Switch state directory to mean /var/lib/mailping and not + /var/lib/mailping/state. Fixes a bug where mail to mailping@.. was + delivered to /var/lib/mailping/state/Maildir. + + * New features: + - Provide default values for "from" and "to". + - Reload munin-node in postinst and postrm if we touched plugins. + + * Documentation improvements: + - Add manpages for mailping-success, mailping-latency. + - Munin plugins are not in $PATH, so show them with full pathname in + synopsis. + - Make Munin plugin manpages refer to munin-run(8), too. + + * Bugfixes: + - Crontab seems to want the full if syntax instead of "[ test ] && + foo". Not bothering to find out why, as the fix is trivial. + - Fix a bug where "admin" was a mandatory configuration option; it + should be optional. + + * Cleanups: + - Be polite and say "quit" and end of the SMTP session. + - In error and usage messages, only print basename of executable. + + * Internals: + - Split non-maildir-related things from MailPing.maildir to + MailPing.mail. + - Rename fileutil.mtime() to fileutil.getTime(), it's been long since + it had anything to do with file modification times. + - Add unit test to ensure there is no race between creation of + statedir and delivery of first email from probe; that is, delivery + can create the maildir on its own (and maildir-cron will have + created the statedir by that time). + + * Packaging: + - Add a small shell script man/run to help non-Debian generation of + manpages. + - Remove generated manpages when cleaning. + - Make postinst and postrm plugin handling look similar. + - Add license texts to debian/copyright. + + -- Tommi Virtanen Fri, 16 Apr 2004 21:07:56 +0300 + +mailping (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Tommi Virtanen Fri, 16 Apr 2004 14:33:17 +0300 + --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/compat +++ mailping-0.0.4ubuntu5+really0.0.4/debian/compat @@ -0,0 +1 @@ +9 --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/control +++ mailping-0.0.4ubuntu5+really0.0.4/debian/control @@ -0,0 +1,23 @@ +Source: mailping +Section: mail +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian QA Group +Standards-Version: 3.9.6 +Build-Depends: debhelper (>= 9), python, dh-python +Build-Depends-Indep: xsltproc, docbook-xml, docbook-xsl + +Package: mailping +Architecture: all +Depends: munin-node, adduser, ${python:Depends}, ${misc:Depends} +Description: monitor email service availability and functioning + Monitor email service availability and functioning. Tests the whole + route from SMTP submission to local delivery, not just whether an + SMTP server accepts TCP connections. + . + Multiple email servers can be tested by creating a remote alias that + points back to a local address, and sending test emails to it. + . + The results of this monitoring are available as graphs via Munin + plugins, and can be connected to Nagios to send alerts when the test + emails no longer get delivered, or if the delivery takes too long. --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/copyright +++ mailping-0.0.4ubuntu5+really0.0.4/debian/copyright @@ -0,0 +1,32 @@ +This package was debianized by Tommi Virtanen tv@debian.org on +Wed, 14 Apr 2004 13:45:51 +0300. It is now maintained by +Thijs Kinkhorst . + +It was originally downloaded from TODO (no upstream web presence yet) + +Upstream Author: Tommi Virtanen + +Copyright: + +""" +Monitor email service availability and functioning. +""" +__copyright__ = "Copyright (C) 2004 Tommi Virtanen" +__license__ = """ + 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +""" + +On Debian Linux systems, the complete text of the GNU General Public +License can be found in '/usr/share/common-licenses/GPL'. --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/lintian-overrides +++ mailping-0.0.4ubuntu5+really0.0.4/debian/lintian-overrides @@ -0,0 +1,11 @@ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/incoming/tmp/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/broken/new/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/pending/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/junk/new/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/broken/tmp/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/junk/cur/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/incoming/cur/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/junk/tmp/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/incoming/new/ +mailping: package-contains-empty-directory usr/share/doc/mailping/examples/state/broken/cur/ +mailping: non-standard-dir-perm var/lib/mailping/Maildir/ 0700 != 0755 --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.cron.d +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.cron.d @@ -0,0 +1,3 @@ +MAILTO=root + +*/5 * * * * mailping if [ -x /usr/bin/mailping-cron ]; then /usr/bin/mailping-cron; fi --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.dirs +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.dirs @@ -0,0 +1,9 @@ +etc/mailping +etc/cron.d +usr/bin +usr/share/mailping/munin-plugins +usr/share/pyshared +var/lib/mailping/state +var/lib/mailping/Maildir/new +var/lib/mailping/Maildir/cur +var/lib/mailping/Maildir/tmp --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.docs +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.docs @@ -0,0 +1 @@ +README --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.examples +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.examples @@ -0,0 +1 @@ +doc/examples/* --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.install +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.install @@ -0,0 +1,4 @@ +doc/examples/dot-forward usr/share/mailping +bin/* usr/bin +munin-plugins/* usr/share/mailping/munin-plugins +MailPing usr/share/pyshared --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.manpages +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.manpages @@ -0,0 +1 @@ +man/*.1 --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.postinst +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.postinst @@ -0,0 +1,60 @@ +#! /bin/sh + +set -e + +prevver="$2" + +add_system_user() { + if ! getent passwd mailping >/dev/null; then + adduser --group --system --no-create-home --home /var/lib/mailping mailping + fi +} + +fixperms() { + chown -R mailping:mailping \ + /var/lib/mailping/state \ + /var/lib/mailping/Maildir +} + +init_plugins() { + if [ -z "$prevver" ]; then + RELOAD=0 + echo -n "Initializing plugins.." + for plugin in success latency; do + if [ ! -e "/etc/munin/plugins/mailping-$plugin" ]; then + RELOAD=1 + echo -n " '$plugin'" + ln -s "/usr/share/mailping/munin-plugins/mailping-$plugin" "/etc/munin/plugins/mailping-$plugin" + fi + done + echo "." + if [ "$RELOAD" = "1" ]; then + invoke-rc.d munin-node force-reload + fi + fi +} + +create_forward() { + FORWARD=/var/lib/mailping/.forward + if [ ! -e /var/lib/mailping/do-not-touch-forward -a ! -e "$FORWARD" ]; then + install -m0644 /usr/share/mailping/dot-forward "$FORWARD" + fi +} + +case "$1" in + configure) + add_system_user + fixperms + create_forward + init_plugins + ;; + abort-upgrade|abort-deconfigure|abort-remove) + : + ;; + *) + echo "Called with unknown argument $1, bailing out." + exit 1 + ;; +esac + +#DEBHELPER# --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/mailping.postrm +++ mailping-0.0.4ubuntu5+really0.0.4/debian/mailping.postrm @@ -0,0 +1,30 @@ +#! /bin/sh +set -e + +remove_plugins() { + RELOAD=0 + echo -n "Removing plugins.." + for plugin in success latency; do + LINK="/etc/munin/plugins/mailping-$plugin" + if [ -L "$LINK" ]; then + TARGET="$(readlink "$LINK")" + if [ "$TARGET" = "/usr/share/mailping/munin-plugins/mailping-$plugin" ]; then + RELOAD=1 + echo -n " '$plugin'" + rm "$LINK" + fi + fi + done + echo "." + if [ "$RELOAD" = "1" ]; then + invoke-rc.d munin-node force-reload + fi +} + +if [ "$1" = "remove" ]; then + remove_plugins +elif [ "$1" = "purge" ]; then + rm -rf /var/lib/mailping +fi + +#DEBHELPER# --- mailping-0.0.4ubuntu5+really0.0.4.orig/debian/rules +++ mailping-0.0.4ubuntu5+really0.0.4/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: + dh_testdir + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f man/*.1 + rm -f build-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_installdirs + dh_install + cd man && ./run + mkdir -p debian/mailping/usr/share/lintian/overrides + cp debian/lintian-overrides debian/mailping/usr/share/lintian/overrides/mailping + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_installcron + dh_installchangelogs + chmod 0700 debian/mailping/var/lib/mailping/Maildir + dh_link + dh_python2 + dh_compress + dh_fixperms -X/var + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install + --- mailping-0.0.4ubuntu5+really0.0.4.orig/man/mailping-cron.1.xml +++ mailping-0.0.4ubuntu5+really0.0.4/man/mailping-cron.1.xml @@ -15,6 +15,9 @@ mailping + + 0.0.4 + 2004-04-15 --- mailping-0.0.4ubuntu5+really0.0.4.orig/man/mailping-latency.1.xml +++ mailping-0.0.4ubuntu5+really0.0.4/man/mailping-latency.1.xml @@ -15,6 +15,9 @@ mailping + + 0.0.4 + 2004-04-16 --- mailping-0.0.4ubuntu5+really0.0.4.orig/man/mailping-store.1.xml +++ mailping-0.0.4ubuntu5+really0.0.4/man/mailping-store.1.xml @@ -15,6 +15,9 @@ mailping + + 0.0.4 + 2004-04-15 --- mailping-0.0.4ubuntu5+really0.0.4.orig/man/mailping-success.1.xml +++ mailping-0.0.4ubuntu5+really0.0.4/man/mailping-success.1.xml @@ -15,6 +15,9 @@ mailping + + 0.0.4 + 2004-04-16