]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Merge commit 'refs/merge-requests/3' of git://gitorious.org/dma/dma
authorSimon Schubert <2@0x2c.org>
Tue, 15 Nov 2011 21:44:08 +0000 (22:44 +0100)
committerSimon Schubert <2@0x2c.org>
Tue, 15 Nov 2011 21:44:08 +0000 (22:44 +0100)
BSDmakefile
LICENSE [new file with mode: 0644]
Makefile
VERSION
crypto.c
debian/changelog
dns.c
local.c
mail.c
util.c

index 051f5642d7c01c4dd31abf3ec209e25087159a4e..9042c8c082ee5c40f9750d170159d17ab7976944 100644 (file)
@@ -1,8 +1,11 @@
 # $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}"'
 
 DPADD=  ${LIBSSL} ${LIBCRYPTO}
 LDADD=  -lssl -lcrypto
@@ -12,6 +15,9 @@ 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
+
 BINOWN= root
 BINGRP= mail
 BINMODE=2555
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..b89e5bc
--- /dev/null
+++ b/LICENSE
@@ -0,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 <matthias@dragonflybsd.org>, 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 <Todd.Miller@courtesan.com>
+
+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 <imp@freebsd.org>
+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.
index 266d0b4a0be14defd83447ffab68aacbff4185d0..0ae0db41a49936c0acd019a8462f9625ce3b1e8b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ aliases_scan.c: aliases_scan.l
        ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $<
 
 dma: ${OBJS}
-       ${CC} ${LDFLAGS} ${LDADD} -o $@ ${OBJS}
+       ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
 
 
 dch:
diff --git a/VERSION b/VERSION
index 60fe1f267badc7a9d0cb936f49f165395f00e25a..a85e614638c8ba6f751123c1fc9dcca392a874b3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-v0.2
+v0.3
index 8e2d33483bcafeb79f6101ad5439b805576a1ef2..60837b194b90d4e2bc00e57bd83786e6f3d3f671 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -80,7 +80,7 @@ int
 smtp_init_crypto(int fd, int feature)
 {
        SSL_CTX *ctx = NULL;
-       SSL_METHOD *meth = NULL;
+       const SSL_METHOD *meth = NULL;
        X509 *cert;
        int error;
 
index 4d6a2de17cd4fae2a54b3e59ed2aae13c05c5678..41f02060d0617873bb53cd89402e014a8119d167 100644 (file)
@@ -1,3 +1,27 @@
+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 <addresses>
+
+ -- Simon Schubert <2@0x2c.org>  Sat, 09 Jul 2011 02:38:05 +0200
+
 dma (0.2) unstable; urgency=low
 
   * Update to dma 0.2
diff --git a/dns.c b/dns.c
index ef78e64d2db4e03ecab646cb294ae162bf1bd9e0..ce80745730e91d2bc728ed068bfdc30ffa87dcc7 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -105,7 +105,7 @@ add_host(int pref, const char *host, int port, struct mx_hostentry **he, size_t
        }
        freeaddrinfo(res0);
 
-       return (*ps - onhosts);
+       return (0);
 
 out:
        if (res0 != NULL)
diff --git a/local.c b/local.c
index fd816ddfd86963427befcb3dfa593af2d20f8fba..694dd845766a02827fdecf7ac1e9c21863d1c0e3 100644 (file)
--- a/local.c
+++ b/local.c
@@ -40,6 +40,7 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <paths.h>
+#include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <syslog.h>
diff --git a/mail.c b/mail.c
index 3c0ab1b7586b88f3e575c30a2954af81a420b5c3..e0a22af19c8d55a57a21711525a4158aa506a2ad 100644 (file)
--- a/mail.c
+++ b/mail.c
@@ -290,6 +290,16 @@ again:
 
                case ',':
                case ';':
+                       /*
+                        * Next address, copy previous one.
+                        * However, we might be directly after
+                        * a <address>, or have two consecutive
+                        * commas.
+                        * Skip the comma unless there is
+                        * really something to copy.
+                        */
+                       if (ps->pos == 0)
+                               goto skip;
                        s++;
                        goto newaddr;
 
@@ -341,6 +351,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
        int had_from = 0;
        int had_messagid = 0;
        int had_date = 0;
+       int had_last_line = 0;
        int nocopy = 0;
 
        parse_state.state = NONE;
@@ -360,12 +371,20 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
                return (-1);
 
        while (!feof(stdin)) {
-               if (fgets(line, sizeof(line), stdin) == NULL)
+               if (fgets(line, sizeof(line) - 1, stdin) == NULL)
                        break;
+               if (had_last_line)
+                       errlogx(1, "bad mail input format");
                linelen = strlen(line);
                if (linelen == 0 || line[linelen - 1] != '\n') {
-                       errno = EINVAL;         /* XXX mark permanent errors */
-                       return (-1);
+                       /*
+                        * This line did not end with a newline character.
+                        * If we fix it, it better be the last line of
+                        * the file.
+                        */
+                       line[linelen] = '\n';
+                       line[linelen + 1] = 0;
+                       had_last_line = 1;
                }
                if (!had_headers) {
                        /*
@@ -415,7 +434,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
                                        snprintf(line, sizeof(line), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n",
                                                 (uintmax_t)time(NULL),
                                                 queue->id,
-                                                random(),
+                                                (uintmax_t)random(),
                                                 hostname());
                                } else if (!had_from) {
                                        had_from = 1;
diff --git a/util.c b/util.c
index b32919d14e762fe94e2dccac3b83ef04e5c20594..a139b20d383166db75fd48f722f506509942f96f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -51,6 +51,9 @@
 const char *
 hostname(void)
 {
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX  255
+#endif
        static char name[HOST_NAME_MAX+1];
        static int initialized = 0;
        char *s;