Provides: mail-transport-agent
Conflicts: mail-transport-agent
Replaces: mail-transport-agent
+Recommends: safecat
Description: the DragonFly Mail Agent, a lightweight MTA
The DragonFly Mail Agent is a small Mail Transport Agent (MTA),
designed for home and office use. It accepts mails from locally
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2009 Peter Pentchev
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+set -e
+
+usage()
+{
+ cat <<EOUSAGE
+Usage: dbounce-simple-safecat [-a addr] [-d dir] [-i queueid] [-t type] -f msg
+ -a the recipient of the bounced message
+ -d the bounce directory, default $DEFBOUNCEDIR
+ -f the full path to the bounced message to process
+ -i the ID of the bounce message in the local MTA's queue
+ -t the MTA type, currently ignored
+EOUSAGE
+}
+
+DEFBOUNCEDIR='/var/spool/mail/dma-bounces'
+BOUNCEDIR="$DEFBOUNCEDIR"
+
+while getopts 'a:d:f:i:t:' o; do
+ case "$o" in
+ a)
+ ADDR="$OPTARG"
+ ;;
+ d)
+ BOUNCEDIR="$OPTARG"
+ ;;
+ f)
+ FILENAME="$OPTARG"
+ ;;
+ i)
+ QUEUEID="$OPTARG"
+ ;;
+ t)
+ MTA="$OPTARG"
+ ;;
+ *)
+ usage 1>&2
+ exit 1
+ esac
+done
+
+if [ ! -r "$FILENAME" ]; then
+ echo "Nonexistent or unreadable bounce file $FILENAME" 1>&2
+ exit 1
+fi
+
+F=`safecat "$BOUNCEDIR/tmp" "$BOUNCEDIR/new" < "$FILENAME"`
+OUTFILE="$BOUNCEDIR/new/$F"
+if [ ! -f "$OUTFILE" ]; then
+ echo "safecat indicated success, but '$OUTFILE' does not exist" 1>&2
+ exit 1
+fi
+echo "Successfully written the message to $OUTFILE"
--- /dev/null
+.\" Copyright (c) 2009 Peter Pentchev
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd March 12, 2009
+.Dt DBOUNCE-SIMPLE-SAFECAT 1
+.Os
+.Sh NAME
+.Nm dbounce-simple-safecat
+.Nd store double-bounced email messages into a Maildir
+.Sh SYNOPSIS
+.Nm
+.Op Fl a Ar addr
+.Op Fl d Ar dir
+.Op Fl i Ar queueid
+.Op Fl t Ar type
+.Fl f Ar msg
+.Sh DESCRIPTION
+The
+.Nm
+utility reads an email message file from the local MTA's queue directory and
+invokes the
+.Xr safecat 1
+utility to store it into a Maildir-format directory for the administrator's
+perusal.
+It is intended to be used as a double-bounce handler by mail transfer agents
+such as
+.Xr dma 8
+(when dma's
+.Va DBOUNCEPROG
+configuration setting is specified).
+.Pp
+The
+.Nm
+utility accepts the following command-line options; only
+.Fl f
+is mandatory:
+.Pp
+.Bl -tag -width "-i queueid"
+.It Fl a Ar addr
+The recipient of the bounce message.
+.It Fl d Ar dir
+The bounce directory,
+.Pa /var/spool/mail/dma-bounces
+by default.
+.It Fl f Ar msg
+The full path to the bounced message to process.
+.It Fl i Ar queueid
+The ID of the bounce message in the local MTA's queue.
+.It Fl t Ar type
+The MTA type, currently unused.
+.El
+.Sh EXAMPLES
+Copy a message from the local
+.Xr dma 8
+queue into the default double-bounce Maildir:
+.Pp
+.Dl dbounce-simple-safecat -a roam@ringlet.net -i 40c1b8.882e250 -t dma -f /var/spool/dma/40c1b8.882e250
+.Pp
+A minimal execution with only the mandatory parameters:
+.Pp
+.Dl dbounce-simple-safecat -f /var/spool/dma/40c1b8.882e250
+.Pp
+Explicitly specify the destination directory:
+.Pp
+.Dl dbounce-simple-safecat -d /root/bounces -f /var/spool/dma/40c1b8.882e250
+.Sh EXIT STATUS
+.Ex -std
+.Sh SEE ALSO
+.Xr safecat 1 ,
+.Xr dma 8
+.Sh HISTORY
+The
+.Nm
+utility was written by Peter Pentchev in 2009.
+.Sh AUTHORS
+.An Peter Pentchev
+.Aq roam@ringlet.net
+.Sh BUGS
+No, thank you :)
+But if you should actually find any, please report them
+to the author.
--- /dev/null
+debian/dbounce-simple-safecat usr/bin
+debian/dbounce-simple-safecat.1 usr/share/man/man1
dh_installchangelogs
dh_installdocs
dh_installexamples
-# dh_install
+ dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate