Import Dragonfly Mail Agent into base system

Operating Systems / FreeBSD - bapt [FreeBSD.org] - 21 February 2014 01:26 UTC



###

Import Dragonfly Mail Agent into base system

It is a small and lightweight Mail Transport Agent.
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, SMTP authentication and NULLCLIENT.

Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL

Reviewed by: peter
Discussed with: emaste, bz, peter


diff --cc contrib/dma/BSDmakefile
index 0000000,0000000..af3a0ac
new file mode 100644
--- /dev/null
+++ b/contrib/dma/BSDmakefile
@@@ -1,0 -1,0 +1,28 @@@
++# $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $
++#
++
++version!= sh get-version.sh
++
++CFLAGS+= -I${.CURDIR}
++CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME
++CFLAGS+= -DLIBEXEC_PATH='"${LIBEXEC}"' -DDMA_VERSION='"${version}"'
++CFLAGS+= -DCONF_PATH='"${CONFDIR}"'
++
++DPADD= ${LIBSSL} ${LIBCRYPTO}
++LDADD= -lssl -lcrypto
++
++PROG= dma
++SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c
++SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c
++MAN= dma.8
++
++PREFIX?= /usr/local
++LIBEXEC?= ${PREFIX}/libexec
++CONFDIR?= ${PREFIX}/etc/dma
++
++BINOWN= root
++BINGRP= mail
++BINMODE=2555
++WARNS?= 6
++
++.include
diff --cc contrib/dma/INSTALL
index 0000000,0000000..3c52dc8
new file mode 100644
--- /dev/null
+++ b/contrib/dma/INSTALL
@@@ -1,0 -1,0 +1,28 @@@
++Installing DMA:
++===============
++
++On most systems (with a development environment installed) you should be able to compile DMA with:
++ make
++
++Once it have compiled it successfully, you can install it with:
++ make install sendmail-link mailq-link install-spool-dirs install-etc
++
++Troubleshooting:
++----------------
++On systems that do not default to a compatible "make" version, try using "gmake" or "pmake" instead of "make". Some known examples of this:
++* Solaris 9
++* Solaris 10
++
++Check that you have the following commands installed:
++* cc - gcc is known to work
++* lex - flex is known to work
++* yacc - bison is kjnown to work
++* make - BSD make and GNU make is knwon to work
++* sh - Need to be POSIX compliant, dash, bash known to work
++* install - GNU and BSD versions known to work
++* openssl - Add the header location to C_INCLUDE_PATH if you get errors about "err.h"
++
++If you have all of these tools installed, set the CC, YACC, INSTALL, LEX and SH variable to point to the relevant location and command.
++
++Example:
++ make CC=gcc YACC=bison LEX=/usr/bin/flex SH=/bin/bash INSTALL=/usr/bin/install
diff --cc contrib/dma/LICENSE
index 0000000,0000000..b89e5bc
new file mode 100644
--- /dev/null
+++ b/contrib/dma/LICENSE
@@@ -1,0 -1,0 +1,109 @@@
++Copyright (c) 2008 The DragonFly Project.
++Copyright (c) 2008-2011, Simon Schubert <2@0x2c.org>.
++All rights reserved.
++
++This code is derived from software contributed to The DragonFly Project
++by Simon Schubert <2@0x2c.org>.
++
++This code is derived from software contributed to The DragonFly Project
++by Matthias Schmidt , University of Marburg,
++Germany.
++
++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.
++3. Neither the name of The DragonFly Project nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific, prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
++COPYRIGHT HOLDERS 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.
++
++
++Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
++(Royal Institute of Technology, Stockholm, Sweden).
++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.
++
++3. Neither the name of the Institute nor the names of its contributors
++ may be used to endorse or promote products derived from this software
++ without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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.
++
++
++Copyright (c) 1998 Todd C. Miller
++
++Permission to use, copy, modify, and distribute this software for any
++purpose with or without fee is hereby granted, provided that the above
++copyright notice and this permission notice appear in all copies.
++
++THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++
++
++Copyright (c) 1998, M. Warner Losh
++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.
diff --cc contrib/dma/Makefile
index 0000000,0000000..aed2ef7
new file mode 100644
--- /dev/null
+++ b/contrib/dma/Makefile
@@@ -1,0 -1,0 +1,111 @@@
++#
++# Depending on your operating system, you might want to influence
++# the conditional inclusion of some helper functions:
++#
++# Define HAVE_* (in caps) if your system already provides:
++# reallocf
++# strlcpy
++# getprogname
++#
++
++SH?= sh
++
++version= $(shell ${SH} get-version.sh)
++debversion= $(shell ${SH} get-version.sh | sed -Ee 's/^v//;s/[.]([[:digit:]]+)[.](g[[:xdigit:]]+)$$/+\1+\2/')
++
++CC?= gcc
++CFLAGS?= -O -pipe
++LDADD?= -lssl -lcrypto -lresolv
++
++CFLAGS+= -Wall -DDMA_VERSION='"${version}"' -DLIBEXEC_PATH='"${LIBEXEC}"' -DCONF_PATH='"${CONFDIR}"'
++
++INSTALL?= install -p
++CHGRP?= chgrp
++CHMOD?= chmod
++
++PREFIX?= /usr/local
++SBIN?= ${PREFIX}/sbin
++LIBEXEC?= ${PREFIX}/lib
++CONFDIR?= /etc/dma
++MAN?= ${PREFIX}/share/man
++VAR?= /var
++DMASPOOL?= ${VAR}/spool/dma
++VARMAIL?= ${VAR}/mail
++SYMLINK?= -s # or empty to create hard link
++
++YACC?= yacc
++LEX?= lex
++LN?= ln
++
++OBJS= aliases_parse.o aliases_scan.o base64.o conf.o crypto.o
++OBJS+= dma.o dns.o local.o mail.o net.o spool.o util.o
++OBJS+= dfcompat.o
++
++all: dma dma-mbox-create
++
++clean:
++ -rm -f .depend dma dma-mbox-create *.[do]
++ -rm -f aliases_parse.[ch] aliases_scan.c
++
++install: all
++ ${INSTALL} -d ${DESTDIR}${SBIN}
++ ${INSTALL} -d ${DESTDIR}${MAN}/man8 ${DESTDIR}${LIBEXEC}
++ ${INSTALL} -m 2755 -o root -g mail dma ${DESTDIR}${SBIN}
++ ${INSTALL} -m 4754 -o root -g mail dma-mbox-create ${DESTDIR}${LIBEXEC}
++ ${INSTALL} -m 0644 dma.8 ${DESTDIR}${MAN}/man8/
++
++sendmail-link:
++ cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma sendmail
++
++mailq-link:
++ cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma mailq
++
++install-spool-dirs:
++ ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${DMASPOOL}
++ ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${VARMAIL}
++
++permissions:
++ -${CHGRP} mail ${DESTDIR}${VARMAIL}/*
++ -${CHMOD} g+w ${DESTDIR}${VARMAIL}/*
++ -${CHMOD} 660 ${DESTDIR}${DMASPOOL}/flush
++
++install-etc:
++ ${INSTALL} -d ${DESTDIR}${CONFDIR}
++ @if [ -e ${DESTDIR}${CONFDIR}/dma.conf ]; then \
++ echo "Not overwriting ${DESTDIR}${CONFDIR}/dma.conf."; \
++ else \
++ echo ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
++ ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
++ fi
++ @if [ -e ${DESTDIR}${CONFDIR}/auth.conf ]; then \
++ echo "Not overwriting ${DESTDIR}${CONFDIR}/auth.conf."; \
++ else \
++ echo ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
++ ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
++ fi
++
++aliases_parse.c: aliases_parse.y
++ ${YACC} -d -o aliases_parse.c aliases_parse.y
++
++aliases_scan.c: aliases_scan.l
++ ${LEX} -t aliases_scan.l > aliases_scan.c
++
++.SUFFIXES: .c .o
++
++.c.o:
++ ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $<
++
++dma: ${OBJS}
++ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
++
++
++dch:
++ dch --release-heuristic changelog -v ${debversion}
++
++
++ppa:
++ @if [ -z '${DEB_DIST}' ]; then echo "please set DEB_DIST to build"; exit 1; fi
++ dch -v "${debversion}~${DEB_DIST}" -D ${DEB_DIST} "${DEB_DIST} build" -b
++ debuild -S -sa
++ ver=$$(dpkg-parsechangelog -n1 | awk '$$1 == "Version:" { print $$2 }'); \
++ dput ppa:corecode/dma ../dma_$${ver}_source.changes
diff --cc contrib/dma/Makefile.etc
index 0000000,0000000..fca23b9
new file mode 100644
--- /dev/null
+++ b/contrib/dma/Makefile.etc
@@@ -1,0 -1,0 +1,15 @@@
++# $DragonFly: src/etc/dma/Makefile,v 1.3 2008/02/12 22:10:20 matthias Exp $
++
++FILESDIR= /etc/dma
++SHAREOWN= root
++SHAREGRP= mail
++FILESMODE= 640
++
++.if !exists(${DESTDIR}/etc/dma/auth.conf)
++FILES+= auth.conf
++.endif
++.if !exists(${DESTDIR}/etc/dma/dma.conf)
++FILES+= dma.conf
++.endif
++
++.include
diff --cc contrib/dma/README.markdown
index 0000000,0000000..13ff20c
new file mode 100644
--- /dev/null
+++ b/contrib/dma/README.markdown
@@@ -1,0 -1,0 +1,32 @@@
++dma -- DragonFly Mail Agent
++===========================
++
++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.
++
++dma is not intended as a replacement for real, big MTAs like sendmail(8)
++or postfix(1). Consequently, dma does not listen on port 25 for
++incoming connections.
++
++
++Building
++--------
++
++ make
++
++
++Installation
++------------
++
++ make install sendmail-link mailq-link install-spool-dirs install-etc
++
++See INSTALL for requirements and configuration options.
++
++
++Contact
++-------
++
++Simon Schubert <2@0x2c.org>
diff --cc contrib/dma/TODO
index 0000000,0000000..01de465
new file mode 100644
--- /dev/null
+++ b/contrib/dma/TODO
@@@ -1,0 -1,0 +1,5 @@@
++- unquote/handle quoted local recipients
++- use proper sysexit codes
++- handle/use ESMTP extensions
++- .forward support
++- suggest way to run a queue flush on boot
diff --cc contrib/dma/VERSION
index 0000000,0000000..490a0cd
new file mode 100644
--- /dev/null
+++ b/contrib/dma/VERSION
@@@ -1,0 -1,0 +1,1 @@@
++v0.9
diff --cc contrib/dma/aliases_parse.y
index 0000000,0000000..a5a9e7b
new file mode 100644
--- /dev/null
+++ b/contrib/dma/aliases_parse.y
@@@ -1,0 -1,0 +1,112 @@@
++%{
++
++#include
++#include
++#include
++#include "dma.h"
++
++extern int yylineno;
++static void yyerror(const char *);
++int yywrap(void);
++int yylex(void);
++
++static void
++yyerror(const char *msg)
++{
++ /**
++ * Because we do error '\n' below, we need to report the error
++ * one line above of what yylineno points to.
++ */
++ syslog(LOG_CRIT, "aliases line %d: %s", yylineno - 1, msg);
++ fprintf(stderr, "aliases line %d: %s\n", yylineno - 1, msg);
++}
++
++int
++yywrap(void)
++{
++ return (1);
++}
++
++%}
++
++%union {
++ char *ident;
++ struct stritem *strit;
++ struct alias *alias;
++}
++
++%token T_IDENT
++%token T_ERROR
++%token T_EOF 0
++
++%type dests
++%type alias aliases
++
++%%
++
++start : aliases T_EOF
++ {
++ LIST_FIRST(&aliases) = $1;
++ }
++
++aliases : /* EMPTY */
++ {
++ $$ = NULL;
++ }
++ | alias aliases
++ {
++ if ($2 != NULL && $1 != NULL)
++ LIST_INSERT_AFTER($2, $1, next);
++ else if ($2 == NULL)
++ $2 = $1;
++ $$ = $2;
++ }
++ ;
++
++alias : T_IDENT ':' dests '\n'
++ {
++ struct alias *al;
++
++ if ($1 == NULL)
++ YYABORT;
++ al = calloc(1, sizeof(*al));
++ if (al == NULL)
++ YYABORT;
++ al->alias = $1;
++ SLIST_FIRST(&al->dests) = $3;
++ $$ = al;
++ }
++ | error '\n'
++ {
++ YYABORT;
++ }
++ ;
++
++dests : T_IDENT
++ {
++ struct stritem *it;
++
++ if ($1 == NULL)
++ YYABORT;
++ it = calloc(1, sizeof(*it));
++ if (it == NULL)
++ YYABORT;
++ it->str = $1;
++ $$ = it;
++ }
++ | T_IDENT ',' dests
++ {
++ struct stritem *it;
++
++ if ($1 == NULL)
++ YYABORT;
++ it = calloc(1, sizeof(*it));
++ if (it == NULL)
++ YYABORT;
++ it->str = $1;
++ SLIST_NEXT(it, next) = $3;
++ $$ = it;
++ }
++ ;
++
++%%
diff --cc contrib/dma/aliases_scan.l
index 0000000,0000000..809d1e1
new file mode 100644
--- /dev/null
+++ b/contrib/dma/aliases_scan.l
@@@ -1,0 -1,0 +1,24 @@@
++%{
++
++#include
++#include "aliases_parse.h"
++
++#define YY_NO_INPUT
++
++int yylex(void);
++%}
++
++%option yylineno
++%option nounput
++
++%%
++
++[^:,#[:space:][:cntrl:]]+ {yylval.ident = strdup(yytext); return T_IDENT;}
++^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */
++[:,\n] return yytext[0];
++(\n?[[:blank:]]+|#.*)+ ;/* ignore whitespace and continuation */
++\\\n ;/* ignore continuation. not allowed in comments */
++. return T_ERROR;
++<> return T_EOF;
++
++%%
diff --cc contrib/dma/auth.conf
index 0000000,0000000..393a80a
new file mode 100644
--- /dev/null
+++ b/contrib/dma/auth.conf
@@@ -1,0 -1,0 +1,4 @@@
++# $DragonFly: src/etc/dma/auth.conf,v 1.1 2008/02/02 18:24:00 matthias Exp $
++#
++# SMTP authentication entries (currently AUTH LOGIN only)
++# Format: user|my.smarthost.example.com:password
diff --cc contrib/dma/base64.c
index 0000000,0000000..663763e
new file mode 100644
--- /dev/null
+++ b/contrib/dma/base64.c
@@@ -1,0 -1,0 +1,135 @@@
++/*
++ * Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
++ * (Royal Institute of Technology, Stockholm, Sweden).
++ * 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.
++ *
++ * 3. Neither the name of the Institute nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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.
++ */
++
++#include
++#include
++
++#include "dma.h"
++
++static char base64_chars[] =
++ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
++
++static int
++pos(char c)
++{
++ char *p;
++ for (p = base64_chars; *p; p++)
++ if (*p == c)
++ return p - base64_chars;
++ return -1;
++}
++
++
++int
++base64_encode(const void *data, int size, char **str)
++{
++ char *s, *p;
++ int i;
++ int c;
++ const unsigned char *q;
++
++ p = s = (char *) malloc(size * 4 / 3 + 4);
++ if (p == NULL)
++ return -1;
++ q = (const unsigned char *) data;
++ i = 0;
++ for (i = 0; i < size;) {
++ c = q[i++];
++ c *= 256;
++ if (i < size)
++ c += q[i];
++ i++;
++ c *= 256;
++ if (i < size)
++ c += q[i];
++ i++;
++ p[0] = base64_chars[(c & 0x00fc0000) >> 18];
++ p[1] = base64_chars[(c & 0x0003f000) >> 12];
++ p[2] = base64_chars[(c & 0x00000fc0) >> 6];
++ p[3] = base64_chars[(c & 0x0000003f) >> 0];
++ if (i > size)
++ p[3] = '=';
++ if (i > size + 1)
++ p[2] = '=';
++ p += 4;
++ }
++ *p = 0;
++ *str = s;
++ return strlen(s);
++}
++
++#define DECODE_ERROR 0xffffffff
++
++static unsigned int
++token_decode(const char *token)
++{
++ int i;
++ unsigned int val = 0;
++ int marker = 0;
++ if (strlen(token) < 4)
++ return DECODE_ERROR;
++ for (i = 0; i < 4; i++) {
++ val *= 64;
++ if (token[i] == '=')
++ marker++;
++ else if (marker > 0)
++ return DECODE_ERROR;
++ else
++ val += pos(token[i]);
++ }
++ if (marker > 2)
++ return DECODE_ERROR;
++ return (marker << 24) | val;
++}
++
++int
++base64_decode(const char *str, void *data)
++{
++ const char *p;
++ unsigned char *q;
++
++ q = data;
++ for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) {
++ unsigned int val = token_decode(p);
++ unsigned int marker = (val >> 24) & 0xff;
++ if (val == DECODE_ERROR)
++ return -1;
++ *q++ = (val >> 16) & 0xff;
++ if (marker < 2)
++ *q++ = (val >> 8) & 0xff;
++ if (marker < 1)
++ *q++ = val & 0xff;
++ }
++ return q - (unsigned char *) data;
++}
++
diff --cc contrib/dma/conf.c
index 0000000,0000000..919ab7c
new file mode 100644
--- /dev/null
+++ b/contrib/dma/conf.c
@@@ -1,0 -1,0 +1,246 @@@
++/*
++ * Copyright (c) 2008 The DragonFly Project. All rights reserved.
++ *
++ * This code is derived from software contributed to The DragonFly Project
++ * by Matthias Schmidt , University of Marburg,
++ * Germany.
++ *
++ * 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.
++ * 3. Neither the name of The DragonFly Project nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific, prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
++ * COPYRIGHT HOLDERS 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.
++ */
++
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++
++#include "dma.h"
++
++#define DP ": \t"
++#define EQS " \t"
++
++
++/*
++ * Remove trailing \n's
++ */
++void
++trim_line(char *line)
++{
++ size_t linelen;
++ char *p;
++
++ if ((p = strchr(line, '\n')))
++ *p = (char)0;
++
++ /* Escape leading dot in every case */
++ linelen = strlen(line);
++ if (line[0] == '.') {
++ if ((linelen + 2) > 1000) {
++ syslog(LOG_CRIT, "Cannot escape leading dot. Buffer overflow");
++ exit(1);
++ }
++ memmove((line + 1), line, (linelen + 1));
++ line[0] = '.';
++ }
++}
++
++static void
++chomp(char *str)
++{
++ size_t len = strlen(str);
++
++ if (len == 0)
++ return;
++ if (str[len - 1] == '\n')
++ str[len - 1] = 0;
++}
++
++/*
++ * Read the SMTP authentication config file
++ *
++ * file format is:
++ * user|host:password
++ *
++ * A line starting with # is treated as comment and ignored.
++ */
++void
++parse_authfile(const char *path)
++{
++ char line[2048];
++ struct authuser *au;
++ FILE *a;
++ char *data;
++ int lineno = 0;
++
++ a = fopen(path, "r");
++ if (a == NULL) {
++ errlog(1, "can not open auth file `%s'", path);
++ /* NOTREACHED */
++ }
++
++ while (!feof(a)) {
++ if (fgets(line, sizeof(line), a) == NULL)
++ break;
++ lineno++;
++
++ chomp(line);
++
++ /* We hit a comment */
++ if (*line == '#')
++ continue;
++ /* Ignore empty lines */
++ if (*line == 0)
++ continue;
++
++ au = calloc(1, sizeof(*au));
++ if (au == NULL)
++ errlog(1, NULL);
++
++ data = strdup(line);
++ au->login = strsep(&data, "|");
++ au->host = strsep(&data, DP);
++ au->password = data;
++
++ if (au->login == NULL ||
++ au->host == NULL ||
++ au->password == NULL) {
++ errlogx(1, "syntax error in authfile %s:%d",
++ path, lineno);
++ /* NOTREACHED */
++ }
++
++ SLIST_INSERT_HEAD(&authusers, au, next);
++ }
++
++ fclose(a);
++}
++
++/*
++ * XXX TODO
++ * Check for bad things[TM]
++ */
++void
++parse_conf(const char *config_path)
++{
++ char *word;
++ char *data;
++ FILE *conf;
++ char line[2048];
++ int lineno = 0;
++
++ conf = fopen(config_path, "r");
++ if (conf == NULL) {
++ /* Don't treat a non-existing config file as error */
++ if (errno == ENOENT)
++ return;
++ errlog(1, "can not open config `%s'", config_path);
++ /* NOTREACHED */
++ }
++
++ while (!feof(conf)) {
++ if (fgets(line, sizeof(line), conf) == NULL)
++ break;
++ lineno++;
++
++ chomp(line);
++
++ /* We hit a comment */
++ if (strchr(line, '#'))
++ *strchr(line, '#') = 0;
++
++ data = line;
++ word = strsep(&data, EQS);
++
++ /* Ignore empty lines */
++ if (word == NULL || *word == 0)
++ continue;
++
++ if (data != NULL && *data != 0)
++ data = strdup(data);
++ else
++ data = NULL;
++
++ if (strcmp(word, "SMARTHOST") == 0 && data != NULL)
++ config.smarthost = data;
++ else if (strcmp(word, "PORT") == 0 && data != NULL)
++ config.port = atoi(data);
++ else if (strcmp(word, "ALIASES") == 0 && data != NULL)
++ config.aliases = data;
++ else if (strcmp(word, "SPOOLDIR") == 0 && data != NULL)
++ config.spooldir = data;
++ else if (strcmp(word, "AUTHPATH") == 0 && data != NULL)
++ config.authpath= data;
++ else if (strcmp(word, "CERTFILE") == 0 && data != NULL)
++ config.certfile = data;
++ else if (strcmp(word, "MAILNAME") == 0 && data != NULL)
++ config.mailname = data;
++ else if (strcmp(word, "MASQUERADE") == 0 && data != NULL) {
++ char *user = NULL, *host = NULL;
++ if (strrchr(data, '@')) {
++ host = strrchr(data, '@');
++ *host = 0;
++ host++;
++ user = data;
++ } else {
++ host = data;
++ }
++ if (host && *host == 0)
++ host = NULL;
++ if (user && *user == 0)
++ user = NULL;
++ config.masquerade_host = host;
++ config.masquerade_user = user;
++ } else if (strcmp(word, "STARTTLS") == 0 && data == NULL)
++ config.features |= STARTTLS;
++ else if (strcmp(word, "OPPORTUNISTIC_TLS") == 0 && data == NULL)
++ config.features |= TLS_OPP;
++ else if (strcmp(word, "SECURETRANSFER") == 0 && data == NULL)
++ config.features |= SECURETRANS;
++ else if (strcmp(word, "DEFER") == 0 && data == NULL)
++ config.features |= DEFER;
++ else if (strcmp(word, "INSECURE") == 0 && data == NULL)
++ config.features |= INSECURE;
++ else if (strcmp(word, "FULLBOUNCE") == 0 && data == NULL)
++ config.features |= FULLBOUNCE;
++ else if (strcmp(word, "NULLCLIENT") == 0 && data == NULL)
++ config.features |= NULLCLIENT;
++ else {
++ errlogx(1, "syntax error in %s:%d", config_path, lineno);
++ /* NOTREACHED */
++ }
++ }
++
++ if ((config.features & NULLCLIENT) && config.smarthost == NULL) {
++ errlogx(1, "%s: NULLCLIENT requires SMARTHOST", config_path);
++ /* NOTREACHED */
++ }
++
++ fclose(conf);
++}
diff --cc contrib/dma/crypto.c
index 0000000,0000000..897b55b
new file mode 100644
--- /dev/null
+++ b/contrib/dma/crypto.c
@@@ -1,0 -1,0 +1,312 @@@
++/*
++ * Copyright (c) 2008 The DragonFly Project. All rights reserved.
++ *
++ * This code is derived from software contributed to The DragonFly Project
++ * by Matthias Schmidt , University of Marburg,
++ * Germany.
++ *
++ * 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.
++ * 3. Neither the name of The DragonFly Project nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific, prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
++ * COPYRIGHT HOLDERS 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.
++ */
++
++#include
++#include
++#include
++#include
++#include
++#include
++
++#include
++
++#include "dma.h"
++
++static int
++init_cert_file(SSL_CTX *ctx, const char *path)
++{
++ int error;
++
++ /* Load certificate into ctx */
++ error = SSL_CTX_use_certificate_chain_file(ctx, path);
++ if (error < 1) {
++ syslog(LOG_ERR, "SSL: Cannot load certificate `%s': %s", path, ssl_errstr());
++ return (-1);
++ }
++
++ /* Add private key to ctx */
++ error = SSL_CTX_use_PrivateKey_file(ctx, path, SSL_FILETYPE_PEM);
++ if (error < 1) {
++ syslog(LOG_ERR, "SSL: Cannot load private key `%s': %s", path, ssl_errstr());
++ return (-1);
++ }
++
++ /*
++ * Check the consistency of a private key with the corresponding
++ * certificate
++ */
++ error = SSL_CTX_check_private_key(ctx);
++ if (error < 1) {
++ syslog(LOG_ERR, "SSL: Cannot check private key: %s", ssl_errstr());
++ return (-1);
++ }
++
++ return (0);
++}
++
++int
++smtp_init_crypto(int fd, int feature)
++{
++ SSL_CTX *ctx = NULL;
++#if (OPENSSL_VERSION_NUMBER >= 0x00909000L)
++ const SSL_METHOD *meth = NULL;
++#else
++ SSL_METHOD *meth = NULL;
++#endif
++ X509 *cert;
++ int error;
++
++ /* XXX clean up on error/close */
++ /* Init SSL library */
++ SSL_library_init();
++ SSL_load_error_strings();
++
++ meth = TLSv1_client_method();
++
++ ctx = SSL_CTX_new(meth);
++ if (ctx == NULL) {
++ syslog(LOG_WARNING, "remote delivery deferred: SSL init failed: %s", ssl_errstr());
++ return (1);
++ }
++
++ /* User supplied a certificate */
++ if (config.certfile != NULL) {
++ error = init_cert_file(ctx, config.certfile);
++ if (error) {
++ syslog(LOG_WARNING, "remote delivery deferred");
++ return (1);
++ }
++ }
++
++ /*
++ * If the user wants STARTTLS, we have to send EHLO here
++ */
++ if (((feature & SECURETRANS) != 0) &&
++ (feature & STARTTLS) != 0) {
++ /* TLS init phase, disable SSL_write */
++ config.features |= NOSSL;
++
++ send_remote_command(fd, "EHLO %s", hostname());
++ if (read_remote(fd, 0, NULL) == 2) {
++ send_remote_command(fd, "STARTTLS");
++ if (read_remote(fd, 0, NULL) != 2) {
++ if ((feature & TLS_OPP) == 0) {
++ syslog(LOG_ERR, "remote delivery deferred: STARTTLS not available: %s", neterr);
++ return (1);
++ } else {
++ syslog(LOG_INFO, "in opportunistic TLS mode, STARTTLS not available: %s", neterr);
++ return (0);
++ }
++ }
++ }
++ /* End of TLS init phase, enable SSL_write/read */
++ config.features &= ~NOSSL;
++ }
++
++ config.ssl = SSL_new(ctx);
++ if (config.ssl == NULL) {
++ syslog(LOG_NOTICE, "remote delivery deferred: SSL struct creation failed: %s",
++ ssl_errstr());
++ return (1);
++ }
++
++ /* Set ssl to work in client mode */
++ SSL_set_connect_state(config.ssl);
++
++ /* Set fd for SSL in/output */
++ error = SSL_set_fd(config.ssl, fd);
++ if (error == 0) {
++ syslog(LOG_NOTICE, "remote delivery deferred: SSL set fd failed: %s",
++ ssl_errstr());
++ return (1);
++ }
++
++ /* Open SSL connection */
++ error = SSL_connect(config.ssl);
++ if (error < 0) {
++ syslog(LOG_ERR, "remote delivery deferred: SSL handshake failed fatally: %s",
++ ssl_errstr());
++ return (1);
++ }
++
++ /* Get peer certificate */
++ cert = SSL_get_peer_certificate(config.ssl);
++ if (cert == NULL) {
++ syslog(LOG_WARNING, "remote delivery deferred: Peer did not provide certificate: %s",
++ ssl_errstr());
++ }
++ X509_free(cert);
++
++ return (0);
++}
++
++/*
++ * hmac_md5() taken out of RFC 2104. This RFC was written by H. Krawczyk,
++ * M. Bellare and R. Canetti.
++ *
++ * text pointer to data stream
++ * text_len length of data stream
++ * key pointer to authentication key
++ * key_len length of authentication key
++ * digest caller digest to be filled int
++ */
++void
++hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
++ unsigned char* digest)
++{
++ MD5_CTX context;
++ unsigned char k_ipad[65]; /* inner padding -
++ * key XORd with ipad
++ */
++ unsigned char k_opad[65]; /* outer padding -
++ * key XORd with opad
++ */
++ unsigned char tk[16];
++ int i;
++ /* if key is longer than 64 bytes reset it to key=MD5(key) */
++ if (key_len > 64) {
++
++ MD5_CTX tctx;
++
++ MD5_Init(&tctx);
++ MD5_Update(&tctx, key, key_len);
++ MD5_Final(tk, &tctx);
++
++ key = tk;
++ key_len = 16;
++ }
++
++ /*
++ * the HMAC_MD5 transform looks like:
++ *
++ * MD5(K XOR opad, MD5(K XOR ipad, text))
++ *
++ * where K is an n byte key
++ * ipad is the byte 0x36 repeated 64 times
++ *
++ * opad is the byte 0x5c repeated 64 times
++ * and text is the data being protected
++ */
++
++ /* start out by storing key in pads */
++ bzero( k_ipad, sizeof k_ipad);
++ bzero( k_opad, sizeof k_opad);
++ bcopy( key, k_ipad, key_len);
++ bcopy( key, k_opad, key_len);
++
++ /* XOR key with ipad and opad values */
++ for (i=0; i<64; i++) {
++ k_ipad[i] ^= 0x36;
++ k_opad[i] ^= 0x5c;
++ }
++ /*
++ * perform inner MD5
++ */
++ MD5_Init(&context); /* init context for 1st
++ * pass */
++ MD5_Update(&context, k_ipad, 64); /* start with inner pad */
++ MD5_Update(&context, text, text_len); /* then text of datagram */
++ MD5_Final(digest, &context); /* finish up 1st pass */
++ /*
++ * perform outer MD5
++ */
++ MD5_Init(&context); /* init context for 2nd
++ * pass */
++ MD5_Update(&context, k_opad, 64); /* start with outer pad */
++ MD5_Update(&context, digest, 16); /* then results of 1st
++ * hash */
++ MD5_Final(digest, &context); /* finish up 2nd pass */
++}
++
++/*
++ * CRAM-MD5 authentication
++ */
++int
++smtp_auth_md5(int fd, char *login, char *password)
++{
++ unsigned char digest[BUF_SIZE];
++ char buffer[BUF_SIZE], ascii_digest[33];
++ char *temp;
++ int len, i;
++ static char hextab[] = "0123456789abcdef";
++
++ temp = calloc(BUF_SIZE, 1);
++ memset(buffer, 0, sizeof(buffer));
++ memset(digest, 0, sizeof(digest));
++ memset(ascii_digest, 0, sizeof(ascii_digest));
++
++ /* Send AUTH command according to RFC 2554 */
++ send_remote_command(fd, "AUTH CRAM-MD5");
++ if (read_remote(fd, sizeof(buffer), buffer) != 3) {
++ syslog(LOG_DEBUG, "smarthost authentication:"
++ " AUTH cram-md5 not available: %s", neterr);
++ /* if cram-md5 is not available */
++ free(temp);
++ return (-1);
++ }
++
++ /* skip 3 char status + 1 char space */
++ base64_decode(buffer + 4, temp);
++ hmac_md5((unsigned char *)temp, strlen(temp),
++ (unsigned char *)password, strlen(password), digest);
++ free(temp);
++
++ ascii_digest[32] = 0;
++ for (i = 0; i < 16; i++) {
++ ascii_digest[2*i] = hextab[digest[i] >> 4];
++ ascii_digest[2*i+1] = hextab[digest[i] & 15];
++ }
++
++ /* prepare answer */
++ snprintf(buffer, BUF_SIZE, "%s %s", login, ascii_digest);
++
++ /* encode answer */
++ len = base64_encode(buffer, strlen(buffer), &temp);
++ if (len < 0) {
++ syslog(LOG_ERR, "can not encode auth reply: %m");
++ return (-1);
++ }
++
++ /* send answer */
++ send_remote_command(fd, "%s", temp);
++ free(temp);
++ if (read_remote(fd, 0, NULL) != 2) {
++ syslog(LOG_WARNING, "remote delivery deferred:"
++ " AUTH cram-md5 failed: %s", neterr);
++ return (-2);
++ }
++
++ return (0);
++}
diff --cc contrib/dma/debian/NEWS
index 0000000,0000000..36ed11a
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/NEWS
@@@ -1,0 -1,0 +1,29 @@@
++dma (0.0.2010.06.17-3) unstable; urgency=low
++
++ The default delivery mode has been changed to immediate, as it is in
++ the upstream version of dma; the DEFER keyword is now disabled by default
++ in dma.conf.
++
++ -- Peter Pentchev Tue, 27 Jul 2010 13:26:48 +0300
++
++dma (0.0.2010.06.17-1) unstable; urgency=low
++
++ The dma spool directory format has changed. The Debian package of dma now
++ recommends a separate package containing the dma-migrate utility; if it is
++ present, it will be invoked at each periodic dma queue flush and attempt to
++ convert the existing old-style queued messages to the new format. In most
++ cases, this should not incur any performance penalties in normal operation,
++ since dma-migrate will scan the spool directory and ignore any new messages
++ (they should already be in the new format); however, if it appears that
++ the periodic queue flush runs take longer than usual to start up, you may
++ remove the dma-migrate package once you have ascertained that your queue
++ directory (/var/spool/dma) only contains files with names beginning with
++ the letters M or Q.
++
++ This version of dma knows how to perform MX lookups, so remote delivery is
++ now possible directly, not through a smarthost. However, a smarthost setup
++ might still be preferred on many systems for various reasons - e.g. dynamic
++ address assignment, a central outgoing mailserver, a roaming laptop, etc.
++
++ -- Peter Pentchev Mon, 21 Jun 2010 11:03:57 +0300
++
diff --cc contrib/dma/debian/README.Debian
index 0000000,0000000..564aaa7
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/README.Debian
@@@ -1,0 -1,0 +1,12 @@@
++dma for Debian
++--------------
++
++Smarthost operation by default - needs to be configured!
++
++After first installing dma, you need to configure it for proper operation -
++whether it should deliver all outgoing e-mail messages through a single
++smarthost or attempt to contact the remote mail servers directly. This should
++be configured through the debconf questions, but you may change the setting
++using the SMARTHOST directive in the /etc/dma/dma.conf file.
++
++ -- Simon Schubert <2@0x2c.org> Fri, 29 Oct 2010 00:25:48 +0200
diff --cc contrib/dma/debian/changelog
index 0000000,0000000..4d55300
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/changelog
@@@ -1,0 -1,0 +1,297 @@@
++dma (0.9) unstable; urgency=low
++
++ [ Ed Maste ]
++ * Be explicit about missing user.
++ * Allow DMA_ROOT_USER & DMA_GROUP to be overridden.
++ * Add compat #ifdef for older OpenSSL
++ * Add CONF_DIR, as in Makefile
++ * More detailed error message for tmp file failure.
++
++ [ Simon Schubert ]
++ * spool.c: bzero contents of pointer
++
++ -- Simon Schubert <2@0x2c.org> Mon, 03 Jun 2013 15:58:44 +0200
++
++dma (0.8) unstable; urgency=low
++
++ [ Gert van den Berg ]
++ * Added some more documentation on compiling
++ * Make Makefile and README consistent with INSTALL
++
++ [ Sascha Wildner ]
++ * dma.8: Fix a few small issues.
++
++ [ Simon Schubert ]
++ * dma.8: we only have 2 config files at the moment
++ * Merge pull request #2 from mohag/master
++ * don't treat -options following -q as argument to it
++ * deliver_remote: propagate back DNS errors
++ * don't complain when we can't lock a queue file during flush
++ * implement queue flushing prod
++
++ -- Simon Schubert <2@0x2c.org> Fri, 30 Mar 2012 12:03:54 +0200
++
++dma (0.7) unstable; urgency=low
++
++ [ Simon Schubert ]
++ * add semicolon before date in Received: header
++ * parse_conf: fix bug with masqueraded domains
++ * clear up warnings found by clang static analysis
++ * mark printf-alike functions
++
++ -- Simon Schubert <2@0x2c.org> Tue, 03 Jan 2012 14:53:43 +0100
++
++dma (0.6) unstable; urgency=low
++
++ [ Simon Schubert ]
++ * deliver_local: quote "From " more liberally
++
++ -- Simon Schubert <2@0x2c.org> Wed, 07 Dec 2011 12:42:22 +0100
++
++dma (0.5) unstable; urgency=low
++
++ [ Simon Schubert ]
++ * implement masquerading using the MASQUERADE config option
++ * access config files at CONF_PATH, add makefile target to install conf files
++ * implement the "*" catch-all alias
++
++ -- Simon Schubert <2@0x2c.org> Wed, 16 Nov 2011 13:34:43 +0100
++
++dma (0.4) unstable; urgency=low
++
++ [ Simon Schubert ]
++ * Makefile: put libraries at the end when linking
++ * LICENSE: add
++ * Merge commit 'refs/merge-requests/3' of git://gitorious.org/dma/dma
++ * Merge commit 'refs/merge-requests/4' of git://gitorious.org/dma/dma
++ * Add symlink for sendmail which is expected by many packages
++ * Makefile: create spool directories in a separate target
++ * Makefile: add symlink for mailq
++ * README: elaborate, use markdown
++
++ [ Peter Pentchev ]
++ * Fix straight SSL/TLS delivery to remote MX's.
++ * Fix a minor memory leak discovered by cppcheck.
++
++ -- Simon Schubert <2@0x2c.org> Wed, 16 Nov 2011 00:08:28 +0100
++
++dma (0.3) unstable; urgency=low
++
++ [ Simon Schubert ]
++ * todo: we create mboxes properly now
++ * dma-mbox-create: group mail only needs to write to mboxes
++ * errlog: preserve errno
++ * dma-mbox-create: add error/status logging
++ * dns_get_mx_list: handle errors properly
++
++ [ Peter Pentchev ]
++ * Make add_host() really return an error code.
++
++ [ Simon Schubert ]
++ * readmail: accept mail without newline at the end
++
++ [ Peter Pentchev ]
++ * In OpenSSL 1.0, TLSv1_client_method() returns a const pointer.
++
++ [ Simon Schubert ]
++ * make dma compile again on DragonFly
++ * parse_addrs: fix parsing for multiple
++
++ -- Simon Schubert <2@0x2c.org> Sat, 09 Jul 2011 02:38:05 +0200
++
++dma (0.2) unstable; urgency=low
++
++ * Update to dma 0.2
++ - debian: better mark as UNRELEASED
++ - add ppa makefile recipe
++ - TODO: suggest way to run a queue flush on boot
++ - partially adopt 34-manpage-defaults.patch: AUTHPATH is not set by default
++ - Revert "debian: better mark as UNRELEASED"
++ - setlogident: openlog() wants a static variable
++ - writequeuef: create files with g+rw
++ - drop privileges when run by root
++ - implement mbox creation via setuid helper
++ - debian: build with consistent flags
++ - debian: remove unused files
++ - debian: fix lintian warnings and errors
++ - make ppa: force lower version number
++ - make ppa: proper name
++
++ -- Simon Schubert <2@0x2c.org> Sun, 31 Oct 2010 23:57:50 +0100
++
++dma (0.1) unstable; urgency=low
++
++ * Update dma to 0.1
++
++ -- Simon Schubert <2@0x2c.org> Fri, 29 Oct 2010 00:57:26 +0200
++
++dma (0.0.2010.06.17-6) unstable; urgency=low
++
++ * Add the 37-gnu-hurd patch to really fix the FTBFS on GNU/Hurd.
++ * Convert several shell output assignments from = to :=
++ * Switch to bzip2 compression for the Debian tarball.
++
++ -- Peter Pentchev Sun, 17 Oct 2010 00:08:33 +0300
++
++dma (0.0.2010.06.17-5) unstable; urgency=low
++
++ * Only use SA_NOCLDWAIT if available to fix the Hurd FTBFS.
++
++ -- Peter Pentchev Thu, 07 Oct 2010 11:42:23 +0300
++
++dma (0.0.2010.06.17-4) unstable; urgency=low
++
++ * Fix an infinite loop in dma-migrate if char is unsigned.
++ Closes: #599172
++ * Switch to Git and point the Vcs-* fields to Gitorious.
++
++ -- Peter Pentchev Wed, 06 Oct 2010 17:30:29 +0300
++
++dma (0.0.2010.06.17-3) unstable; urgency=low
++
++ * Update the debconf translations:
++ - French by Steve Petruzzello; Closes: #587883
++ * Bump Standards-Version to 3.9.1 with no changes.
++ * Disable deferred delivery by default, as in the upstream version:
++ - in the 03-debian-locations patch, comment the DEFER keyword in dma.conf,
++ as it is upstream
++ - refresh the 11-double-bounce.patch
++ - reword the README.Debian section on deferred delivery a bit
++ - add a news blurb
++
++ -- Peter Pentchev Tue, 27 Jul 2010 13:34:27 +0300
++
++dma (0.0.2010.06.17-2) unstable; urgency=low
++
++ * Quick on the heels of -1 to fix a momentary lapse of reason on my part:
++ in the 03-debian-locations patch, revert part of the 0.0.2010.06.17-1
++ change: do not set a un-overrideable default for the deferred delivery!
++ Closes: #587593
++ * Update the debconf translations:
++ - Japanese by Hideki Yamane; Closes: #587543
++
++ -- Peter Pentchev Wed, 30 Jun 2010 11:59:46 +0300
++
++dma (0.0.2010.06.17-1) unstable; urgency=low
++
++ * New upstream version:
++ - no longer reports the remote port number; Closes: #544820
++ - fixes some queue locking problems; Closes: #582593
++ - adapt the rules file to use the GNU Makefile instead of the BSD one
++ - drop pmake from Build-Depends
++ - remove the 01-debian-build patch, overtaken by upstream changes
++ - in the 03-debian-locations patch, make the Debian defaults actual
++ defaults for the dma binary, not just in the dma.conf file
++ - adapt the 04-debian-setgid patch for the GNU Makefile
++ - in the 10-liblockfile patch, change the GNU Makefile, too
++ - enhance the 11-double-bounce patch a bit:
++ - use dma's own delqueue() function instead of a naive unlink() so
++ all the queue files are cleaned up
++ - document the Debian default for DBOUNCEPROG in the manual page
++ - resurrect the 13-hardening patch, correcting a couple of
++ unchecked asprintf(3) and vasprintf(3) invocations
++ - the functionality of the 20-parse-recipient patch was implemented
++ upstream in a different way, so replace it with a small bugfix
++ - remove the 22-openfiles patch, overtaken by upstream changes
++ - in the 24-random-message-id patch, change the GNU Makefile, too
++ - add the 27-int-size patch to cast a variable to the correct type
++ - add the 28-valid-recipient patch to fix parsing recipients out of
++ the message body
++ - add the 29-double-free patch to fix a double-free error
++ - add the 30-ldflags patch to honor LDFLAGS if specified
++ - refresh the 09-typos, 17-mailname, 23-dirent-d_type, and
++ 25-unsupported-starttls patches
++ - teach the dbounce-simple-safecat handler about the M*/Q* spool
++ files scheme
++ * Bump Standards-Version to 3.9.0 with no changes.
++ * Update the copyright file:
++ - bring it up to the latest revision of the DEP 5
++ - update the upstream copyright notices
++ - bump the year on my copyright notice
++ * Remove the diffsrc rules target which was intended for my own
++ internal use, but has outlived its time.
++ * Use dpkg-buildflags from dpkg-dev >= 1.15.7~ to get the default
++ values for CFLAGS, CPPFLAGS, and LDFLAGS; no longer rely on
++ dpkg-buildpackage to set them by default.
++ * Add the dma-migrate utility (in a separate binary package) to convert
++ spool files to the new queue format (M* and Q* files for each message)
++ * Add a dma-migrate invocation to dma.cron.d
++ * Shorten the Vcs-Browser URL.
++ * Add the 31-sigalrm-backoff patch to force a delivery attempt on SIGALRM.
++ * Properly substitute the debconf-supplied values for DBOUNCEPROG and
++ SMARTHOST into dma.conf even if they are empty without generating
++ an invalid dma.conf file.
++ * Remove the smarthost default; dma does MX lookups now, so it doesn't
++ really *need* one anymore.
++ * Reword the debconf relayhost question - dma does not really need
++ a smarthost anymore.
++ * Update the debconf translations:
++ - Bulgarian
++ - Portuguese by Américo Monteiro
++ - German by Helge Kreutzmann; Closes: #586531
++ - Russian by Yuri Kozlov; Closes: #586579
++ - Czech by Michal Simunek; Closes: #586791
++ - Swedish by Martin Bagge; Closes: #586825
++ - Spanish by Francisco Javier Cuadrado; Closes: #587088
++ * Update the smarthost configuration information in README.Debian.
++ * Add the 32-comment-uncomment patch to correct the manual page wording.
++ * Add the 33-opportunistic-tls patch to allow remote connections to proceed
++ even if the STARTTLS negotiation fails.
++ * Fix the 25-unsupported-starttls patch to actually error out if the SSL
++ negotiation fails.
++ * Forward all the non-Debian-specific patches upstream to Simon Schubert.
++ * Add the 34-manpage-defaults patch to properly document what dma will use
++ as default values if not specified in the config file instead of what
++ the default config file specifies. Closes: #544748
++ * Add the 35-delivery-retry patch to try local deliveries a bit more often
++ and to randomize the delivery timeout to avoid locking issues.
++
++ -- Peter Pentchev Mon, 28 Jun 2010 23:26:36 +0300
++
++dma (0.0.2009.07.17-3) unstable; urgency=low
++
++ * Really install the files in /etc/dma/ as root/mail/640 and
++ change the ownership of the existing files in the postinst script
++ when upgrading from older versions. Closes: #544664
++ * Install the /usr/bin/mailq and /usr/bin/newaliases symlinks.
++ Closes: #558421
++ * Switch to the 3.0 (quilt) source format.
++ * Update the debconf translations:
++ - add German. Closes: #552754
++ - add Japanese. Closes: #554515
++ - remove a double space and unfuzzy the translations. Closes: #552586
++ * Fix a crash when the SMTP server does not support STARTTLS.
++ Closes: #547594
++ * Always use the user-supplied value from the debconf query for
++ the smarthost and the double-bounce program. This may result in
++ debconf overriding a manually-edited config file, so add a note to
++ dma.conf stating that these values are handled via debconf.
++ Closes: #544663
++ * Fix a misspelling of dma/dbounceprog as dma/defer in the debconf
++ configuration script. Oops.
++
++ -- Peter Pentchev Sat, 19 Dec 2009 14:35:10 +0200
++
++dma (0.0.2009.07.17-2) unstable; urgency=low
++
++ * Allow the spool directory to live on a filesystem that does not
++ set the d_type member of the dirent structure, like XFS.
++ Closes: #544357
++ * Randomize the Message-Id a bit more. Closes: #544475
++ * Bump Standards-Version to 3.8.3 with no changes.
++ * Only enable the build hardening wrapper if the "hardening" build
++ option is specified.
++ * Switch the copyright file header from the Wiki to DEP 5.
++ * Remove the manual page ".Dx" patch - the groff version in Squeeze
++ knows about the .Dx mdoc macro. Add a lintian override for
++ the "Unknown DragonFly version" error.
++ * Convert the patch file headers to the DEP 3 format.
++
++ -- Peter Pentchev Tue, 01 Sep 2009 13:36:33 +0300
++
++dma (0.0.2009.07.17-1) unstable; urgency=low
++
++ * Initial release
++ (Closes: #511410, #533458, #533614, #533890, #534101, #534860)
++
++ -- Peter Pentchev Tue, 11 Aug 2009 16:08:41 +0300
diff --cc contrib/dma/debian/compat
index 0000000,0000000..7f8f011
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/compat
@@@ -1,0 -1,0 +1,1 @@@
++7
diff --cc contrib/dma/debian/control
index 0000000,0000000..6eeea08
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/control
@@@ -1,0 -1,0 +1,37 @@@
++Source: dma
++Section: mail
++Priority: optional
++Maintainer: Peter Pentchev
++DM-Upload-Allowed: yes
++Build-Depends: debhelper (>= 7.0.50), byacc, dpkg-dev (>= 1.15.7~), flex, hardening-wrapper, libssl-dev, po-debconf
++Standards-Version: 3.9.1
++Homepage: http://devel.ringlet.net/mail/dma/
++Vcs-Git: git://gitorious.org/dma-roam/pkg-debian.git
++Vcs-Browser: http://gitorious.org/dma-roam/pkg-debian
++
++Package: dma
++Architecture: any
++Depends: ${shlibs:Depends}, ${misc:Depends}
++Provides: mail-transport-agent
++Conflicts: mail-transport-agent
++Replaces: mail-transport-agent
++Recommends: dma-migrate
++Description: lightweight mail transport agent
++ The DragonFly Mail Agent is a small Mail Transport Agent (MTA),
++ designed for home and office use. It accepts mails from local Mail
++ User Agents (MUA) and delivers them either to local mailboxes or
++ remote SMTP servers. Remote delivery includes support for features
++ such as TLS/SSL and SMTP authentication.
++ .
++ dma is not intended as a replacement for full-featured MTAs like
++ Sendmail, Postfix, or Exim. Consequently, dma does not listen on
++ port 25 for incoming connections.
++
++Package: dma-migrate
++Architecture: any
++Depends: ${shlibs:Depends}, ${misc:Depends}
++Enhances: dma
++Description: migration utility for the DragonFly Mail Agent's spool files
++ The dma-migrate utility examines the DragonFly Mail Agent's mail queue
++ and performs any conversions from old message file formats to the most
++ recent one as needed.
diff --cc contrib/dma/debian/copyright
index 0000000,0000000..4ad8fbb
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/copyright
@@@ -1,0 -1,0 +1,91 @@@
++Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
++Name: dma
++
++Files: base64.c
++Copyright: Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
++ (Royal Institute of Technology, Stockholm, Sweden).
++ All rights reserved.
++License: BSD-3
++
++Files: conf.c crypto.c net.c
++Copyright: Copyright (c) 2008 The DragonFly Project. All rights reserved.
++ This code is derived from software contributed to The DragonFly Project
++ by Matthias Schmidt , University of Marburg,
++ Germany.
++License: BSD-3
++
++Files: dfcompat.c
++Copyright: Copyright (c) 1998 Todd C. Miller
++ Copyright (c) 1998, M. Warner Losh All rights reserved.
++License: BSD-1 BSD-2
++
++Files: dma.8
++Copyright: Copyright (c) 2008 The DragonFly Project. All rights reserved.
++License: BSD-3
++
++Files: dma.c dns.c mail.c spool.c util.c
++Copyright: Copyright (c) 2008 The DragonFly Project. All rights reserved.
++ This code is derived from software contributed to The DragonFly Project
++ by Simon 'corecode' Schubert .
++License: BSD-3
++
++Files: dma.h
++Copyright: Copyright (c) 2008 The DragonFly Project. All rights reserved.
++ This code is derived from software contributed to The DragonFly Project
++ by Simon 'corecode' Schubert and
++ Matthias Schmidt .
++License: BSD-3
++
++Files: debian/*
++Copyright: Copyright (c) 2009, 2010 Peter Pentchev.
++License: BSD-3
++
++License: BSD-3
++ 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.
++ 3. Neither the name of The DragonFly Project nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific, prior written permission.
++
++License: BSD-1
++ Permission to use, copy, modify, and distribute this software for any
++ purpose with or without fee is hereby granted, provided that the above
++ copyright notice and this permission notice appear in all copies.
++ .
++ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++
++License: BSD-2
++ 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.
diff --cc contrib/dma/debian/dma-migrate.dirs
index 0000000,0000000..b174b44
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma-migrate.dirs
@@@ -1,0 -1,0 +1,2 @@@
++usr/sbin
++usr/share/man/man8
diff --cc contrib/dma/debian/dma-migrate.install
index 0000000,0000000..1c35b0a
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma-migrate.install
@@@ -1,0 -1,0 +1,1 @@@
++debian/migrate/dma-migrate usr/sbin
diff --cc contrib/dma/debian/dma-migrate.manpages
index 0000000,0000000..3629dbe
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma-migrate.manpages
@@@ -1,0 -1,0 +1,1 @@@
++debian/migrate/dma-migrate.8
diff --cc contrib/dma/debian/dma.dirs
index 0000000,0000000..f10c005
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma.dirs
@@@ -1,0 -1,0 +1,4 @@@
++etc/dma
++usr/sbin
++usr/share/lintian/overrides
++usr/share/man/man8
diff --cc contrib/dma/debian/dma.links
index 0000000,0000000..d9ac22a
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma.links
@@@ -1,0 -1,0 +1,6 @@@
++usr/sbin/dma usr/bin/mailq
++usr/sbin/dma usr/bin/newaliases
++usr/sbin/dma usr/sbin/sendmail
++usr/share/man/man8/dma.8 usr/share/man/man8/mailq.8
++usr/share/man/man8/dma.8 usr/share/man/man8/newaliases.8
++usr/share/man/man8/dma.8 usr/share/man/man8/sendmail.8
diff --cc contrib/dma/debian/dma.lintian-overrides
index 0000000,0000000..03f5d6e
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/dma.lintian-overrides
@@@ -1,0 -1,0 +1,8 @@@
++dma: manpage-has-errors-from-man *Unknown DragonFly version*
++dma: non-standard-dir-in-var var/mail/
++dma: non-standard-dir-perm var/spool/dma/ 0770 != 0755
++dma: non-standard-dir-perm var/spool/dma/ 2775 != 0755
++dma: non-standard-file-perm etc/dma/auth.conf 0640 != 0644
++dma: no-upstream-changelog
++dma: setgid-binary usr/sbin/dma 2755 root/mail
++dma: setuid-binary usr/lib/dma-mbox-create 4754 root/mail
diff --cc contrib/dma/debian/migrate/Makefile
index 0000000,0000000..cc7d347
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/migrate/Makefile
@@@ -1,0 -1,0 +1,4 @@@
++all: dma-migrate
++
++clean:
++ rm -f dma-migrate dma-migrate.o
diff --cc contrib/dma/debian/migrate/NEWS
index 0000000,0000000..29dca0dd
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/migrate/NEWS
@@@ -1,0 -1,0 +1,6 @@@
++Change log for dma-migrate, the DragonFly Mail Agent queue migration utility.
++
++0.01 not yet ;)
++ - first public release
++
++Comments: Peter Pentchev
diff --cc contrib/dma/debian/migrate/dma-migrate.8
index 0000000,0000000..e40acef
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/migrate/dma-migrate.8
@@@ -1,0 -1,0 +1,98 @@@
++.\" Copyright (c) 2010 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 May 11, 2009
++.Dt dma-migrate 8
++.Os
++.Sh NAME
++.Nm dma-migrate
++.Nd convert the DragonFly Mail Agent's queue files
++.Sh SYNOPSIS
++.Nm
++.Op Fl v
++.Op Fl d Ar spooldir
++.Nm
++.Op Fl h | Fl V
++.Sh DESCRIPTION
++The
++.Nm
++utility is used to convert the mail queue files in the
++.Xr dma 8
++spool directory to the latest spool directory format supported by
++the installed version of
++.Xr dma 8 .
++Currently it only handles the conversion from a single file containing
++both message and delivery metadata to the M/Q format.
++.Pp
++The following command-line options are available:
++.Bl -tag -width indent
++.It Fl d
++Specify the location of the
++.Xr dma 8
++spool directory, default
++.Pa /var/spool/dma .
++.It Fl h
++Display usage information and exit.
++.It Fl V
++Display program version information and exit.
++.It Fl v
++Verbose output - display diagnostic messages.
++.El
++.Sh ENVIRONMENT
++The operation of the
++.Nm
++utility is currently not influenced by environment variables.
++.Sh FILES
++The
++.Nm
++utility looks for the
++.Xr dma 8
++mail queue files in the
++.Pa /var/spool/dma
++directory, unless another location is specified by the
++.Fl d
++command-line option.
++.Sh EXIT STATUS
++The
++.Nm
++utility will scan the whole spool directory and attempt to convert all
++suitable files there.
++If there are no files to be converted, or if all the conversions are
++successful, it will complete with an exit code of zero.
++If any conversion errors are encountered, a message will be displayed
++to the standard error stream and
++.Nm
++will exit with an exit code of 1 after attempting to convert the rest of
++the suitable files in the spool directory.
++.Sh SEE ALSO
++.Xr dma 8
++.Sh STANDARDS
++No standards documentation was harmed in the process of creating
++.Nm .
++.Sh BUGS
++Please report any bugs in
++.Nm
++to the author.
++.Sh AUTHOR
++.An Peter Pentchev Aq roam@ringlet.net
diff --cc contrib/dma/debian/migrate/dma-migrate.c
index 0000000,0000000..56bfa2a
new file mode 100644
--- /dev/null
+++ b/contrib/dma/debian/migrate/dma-migrate.c
@@@ -1,0 -1,0 +1,413 @@@
++/*-
++ * Copyright (c) 2010 Peter Pentchev
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, wit

44c7fbc Import Dragonfly Mail Agent into base system

contrib/dma/BSDmakefile | 28 ++
contrib/dma/INSTALL | 28 ++
contrib/dma/LICENSE | 109 ++++++
contrib/dma/Makefile | 111 ++++++
contrib/dma/Makefile.etc | 15 +
contrib/dma/README.markdown | 32 ++
contrib/dma/TODO | 5 +
contrib/dma/VERSION | 1 +
contrib/dma/aliases_parse.y | 112 ++++++
contrib/dma/aliases_scan.l | 24 ++
contrib/dma/auth.conf | 4 +
contrib/dma/base64.c | 135 +++++++
contrib/dma/conf.c | 246 ++++++++++++
contrib/dma/crypto.c | 312 +++++++++++++++
contrib/dma/debian/NEWS | 29 ++
contrib/dma/debian/README.Debian | 12 +
contrib/dma/debian/changelog | 297 ++++++++++++++
contrib/dma/debian/compat | 1 +
contrib/dma/debian/control | 37 ++
contrib/dma/debian/copyright | 91 +++++
contrib/dma/debian/dma-migrate.dirs | 2 +
contrib/dma/debian/dma-migrate.install | 1 +
contrib/dma/debian/dma-migrate.manpages | 1 +
contrib/dma/debian/dma.dirs | 4 +
contrib/dma/debian/dma.links | 6 +
contrib/dma/debian/dma.lintian-overrides | 8 +
contrib/dma/debian/migrate/Makefile | 4 +
contrib/dma/debian/migrate/NEWS | 6 +
contrib/dma/debian/migrate/dma-migrate.8 | 98 +++++
contrib/dma/debian/migrate/dma-migrate.c | 413 +++++++++++++++++++
contrib/dma/debian/rules | 49 +++
contrib/dma/debian/source/format | 1 +
contrib/dma/debian/source/options | 2 +
contrib/dma/dfcompat.c | 122 ++++++
contrib/dma/dfcompat.h | 24 ++
contrib/dma/dma-mbox-create.c | 160 ++++++++
contrib/dma/dma.8 | 363 +++++++++++++++++
contrib/dma/dma.c | 631 ++++++++++++++++++++++++++++++
contrib/dma/dma.conf | 66 ++++
contrib/dma/dma.h | 237 +++++++++++
contrib/dma/dns.c | 280 +++++++++++++
contrib/dma/get-version.sh | 9 +
contrib/dma/local.c | 253 ++++++++++++
contrib/dma/mail.c | 457 ++++++++++++++++++++++
contrib/dma/net.c | 546 ++++++++++++++++++++++++++
contrib/dma/spool.c | 440 +++++++++++++++++++++
contrib/dma/test/quote.rfc2822 | 23 ++
contrib/dma/util.c | 345 ++++++++++++++++
etc/mtree/BSD.root.dist | 2 +
etc/mtree/BSD.var.dist | 2 +
libexec/Makefile | 7 +
libexec/dma/Makefile | 32 ++
share/mk/bsd.own.mk | 2 +
tools/build/mk/OptionalObsoleteFiles.inc | 6 +
tools/build/options/WITHOUT_DMA | 2 +
55 files changed, 6233 insertions(+)

Upstream: github.com


  • Share