From: Peter Pentchev Date: Thu, 17 Jun 2010 14:29:46 +0000 (+0000) Subject: Teach dbounce-simple-safecat about the M*/Q* spool scheme. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fc96c1b82aafe7fe7e2fafcf3ace69c405bbe0c;p=people%2Fms%2Fdma.git Teach dbounce-simple-safecat about the M*/Q* spool scheme. --- diff --git a/changelog b/changelog index 8c54f35..d587e89 100644 --- a/changelog +++ b/changelog @@ -1,7 +1,5 @@ dma (0.0.2009.08.29-1) UNRELEASED; urgency=low - TODO: make sure the double-bounce program works with the new queue format - * New upstream version: - remove the 20-parse-recipient patch, implemented upstream in a different way @@ -21,6 +19,8 @@ dma (0.0.2009.08.29-1) UNRELEASED; urgency=low - refresh 01-debian-build, 03-debian-locations, 04-debian-setgid, 09-typos, 10-liblockfile, 11-double-bounce, 17-mailname, 23-dirent-d_type, 24-random-message-id, and 25-unsupported-starttls + - teach the dbounce-simple-safecat handler about the M*/Q* spool + files scheme * Bump Standards-Version to 3.8.4 with no changes. * Bring the copyright file up to the latest revision of the DEP 5 proposed format and bump the year on my copyright notice. diff --git a/dbounce-simple-safecat b/dbounce-simple-safecat index 429e3e8..d1697ed 100644 --- a/dbounce-simple-safecat +++ b/dbounce-simple-safecat @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2009 Peter Pentchev +# Copyright (c) 2009, 2010 Peter Pentchev # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -69,7 +69,20 @@ if [ ! -r "$FILENAME" ]; then exit 1 fi -F=`safecat "$BOUNCEDIR/tmp" "$BOUNCEDIR/new" < "$FILENAME"` +bname=`basename "$FILENAME"` +dname=`dirname "$FILENAME"` +if expr "$bname" : 'M' > /dev/null; then + qname="Q${bname#M}" + qfile="$dname/$qname" + if [ ! -r "$qfile" ]; then + echo "Nonexistent or unreadable bounce queue file $qfile" 1>&2 + exit 1 + fi +else + qfile='' +fi + +F=`cat ${qfile:+"$qfile"} "$FILENAME" | safecat "$BOUNCEDIR/tmp" "$BOUNCEDIR/new"` OUTFILE="$BOUNCEDIR/new/$F" if [ ! -f "$OUTFILE" ]; then echo "safecat indicated success, but '$OUTFILE' does not exist" 1>&2