From: Peter Pentchev Date: Fri, 18 Jun 2010 14:00:27 +0000 (+0000) Subject: Update to 2010.06.17, part I: adapt the patches. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70f0f49ba8cf871dcb7114a43afe7ad77d745bde;p=people%2Fms%2Fdma.git Update to 2010.06.17, part I: adapt the patches. --- diff --git a/changelog b/changelog index d587e89..94bc61e 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,4 @@ -dma (0.0.2009.08.29-1) UNRELEASED; urgency=low +dma (0.0.2010.07.16-1) UNRELEASED; urgency=low * New upstream version: - remove the 20-parse-recipient patch, implemented upstream in diff --git a/patches/01-debian-build.patch b/patches/01-debian-build.patch index 2bfa800..e91ee84 100644 --- a/patches/01-debian-build.patch +++ b/patches/01-debian-build.patch @@ -1,69 +1,18 @@ Description: Several fixes to make dma build on Debian. - - build and install the files in the etc/ subdirectory; - - generate aliases_parse.h and let the others depend on it; - - define the __DECONST macro; - use mtime instead of mtimespec. Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Forwarded: not-needed Author: Peter Pentchev -Last-Update: 2010-06-02 +Last-Update: 2010-06-18 ---- a/Makefile -+++ b/Makefile -@@ -1,6 +1,8 @@ - # $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $ - # - -+SUBDIR= etc -+ - CFLAGS+= -I${.CURDIR} - - DPADD= ${LIBSSL} ${LIBCRYPTO} -@@ -16,4 +18,23 @@ - BINMODE=2555 - WARNS?= 6 - -+# The pmake Debian package does not seem to deal properly with y.tab.h -+ -+DPSRCS+= aliases_parse.h -+CLEANFILES+= aliases_parse.h -+ -+YFLAGS+= -d -+ -+aliases_parse.c: aliases_parse.y -+ ${YACC} ${YFLAGS} aliases_parse.y -+ mv y.tab.c aliases_parse.c -+ -+aliases_parse.h: aliases_parse.c -+ mv y.tab.h aliases_parse.h -+ -+aliases_parse.o: aliases_parse.h -+aliases_scan.o: aliases_parse.h -+ - .include -+ -+.include --- a/dma.c +++ b/dma.c -@@ -276,7 +276,7 @@ +@@ -295,7 +295,7 @@ exit(1); } if (gettimeofday(&now, NULL) == 0 && -- (now.tv_sec - st.st_mtimespec.tv_sec > MAX_TIMEOUT)) { +- (now.tv_sec - st.st_mtim.tv_sec > MAX_TIMEOUT)) { + (now.tv_sec - st.st_mtime > MAX_TIMEOUT)) { asprintf(__DECONST(void *, &errmsg), "Could not deliver for the last %d seconds. Giving up.", MAX_TIMEOUT); ---- a/dma.h -+++ b/dma.h -@@ -48,6 +48,10 @@ - #endif /* __GNUC__ */ - #endif - -+#ifndef __DECONST -+#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -+#endif /* __DECONST */ -+ - #define VERSION "DragonFly Mail Agent" - - #define BUF_SIZE 2048 diff --git a/patches/03-debian-locations.patch b/patches/03-debian-locations.patch index 4124399..4041cd2 100644 --- a/patches/03-debian-locations.patch +++ b/patches/03-debian-locations.patch @@ -5,7 +5,7 @@ Description: Customize the /etc/dma configuration files for Debian. Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Forwarded: not-needed Author: Peter Pentchev -Last-Update: 2010-06-02 +Last-Update: 2010-06-18 --- a/dma.8 +++ b/dma.8 @@ -27,8 +27,8 @@ Last-Update: 2010-06-02 .Xc Path to the local aliases file. Just stick with the default. ---- a/etc/dma.conf -+++ b/etc/dma.conf +--- a/dma.conf ++++ b/dma.conf @@ -2,13 +2,15 @@ # # Your smarthost (also called relayhost). Leave blank if you don't want @@ -36,17 +36,17 @@ Last-Update: 2010-06-02 -#SMARTHOST +# NOTE: on Debian systems this is handled via debconf! +# Please use dpkg-reconfigure dma to change this value. -+SMARTHOST mail.example.com ++#SMARTHOST mail.example.com # Use this SMTP port. Most users will be fine with the default (25) - PORT 25 + #PORT 25 # Path to your alias file. Just stay with the default. --ALIASES /etc/mail/aliases -+ALIASES /etc/aliases +-#ALIASES /etc/mail/aliases ++#ALIASES /etc/aliases # Path to your spooldir. Just stay with the default. - SPOOLDIR /var/spool/dma + #SPOOLDIR /var/spool/dma @@ -39,7 +41,7 @@ # Uncomment if you want to defer your mails. This is useful if you are @@ -56,3 +56,20 @@ Last-Update: 2010-06-02 # Uncomment if you want the bounce message to include the complete original # message, not just the headers. +--- a/dma.c ++++ b/dma.c +@@ -70,12 +70,12 @@ + struct config config = { + .smarthost = NULL, + .port = 25, +- .aliases = "/var/mail/aliases", ++ .aliases = "/etc/aliases", + .spooldir = "/var/spool/dma", + .virtualpath = NULL, + .authpath = NULL, + .certfile = NULL, +- .features = 0, ++ .features = DEFER, + .mailname = NULL, + .mailnamefile = NULL, + }; diff --git a/patches/04-debian-setgid.patch b/patches/04-debian-setgid.patch deleted file mode 100644 index a8ea18d..0000000 --- a/patches/04-debian-setgid.patch +++ /dev/null @@ -1,34 +0,0 @@ -Description: Install the dma binary with the correct permissions. - As per the Debian Policy, change the /usr/sbin/dma permissions from 2555 - to 2755, since removing root write access gains us nothing. - Also, install the etc/ files with the correct owner and group; it seems - that Debian pmake's bsd.files.mk does not understand SHAREOWN and SHAREGRP. -Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ -Forwarded: not-needed -Author: Peter Pentchev -Last-Update: 2010-06-02 - ---- a/Makefile -+++ b/Makefile -@@ -15,7 +15,7 @@ - - BINOWN= root - BINGRP= mail --BINMODE=2555 -+BINMODE=2755 - WARNS?= 6 - - # The pmake Debian package does not seem to deal properly with y.tab.h ---- a/etc/Makefile -+++ b/etc/Makefile -@@ -1,8 +1,8 @@ - # $DragonFly: src/etc/dma/Makefile,v 1.3 2008/02/12 22:10:20 matthias Exp $ - - FILESDIR= /etc/dma --SHAREOWN= root --SHAREGRP= mail -+FILESOWN= root -+FILESGRP= mail - FILESMODE= 640 - - .if !exists(${DESTDIR}/etc/dma/auth.conf) diff --git a/patches/10-liblockfile.patch b/patches/10-liblockfile.patch index c8dfa7a..76c020b 100644 --- a/patches/10-liblockfile.patch +++ b/patches/10-liblockfile.patch @@ -2,24 +2,8 @@ Description: Dot-lock the user's mailbox with maillock(3) from liblockfile. Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Forwarded: not-needed Author: Peter Pentchev -Last-Update: 2010-06-02 +Last-Update: 2010-06-18 ---- a/Makefile -+++ b/Makefile -@@ -3,10 +3,11 @@ - - SUBDIR= etc - -+CFLAGS+= -DHAVE_LIBLOCKFILE - CFLAGS+= -I${.CURDIR} - --DPADD= ${LIBSSL} ${LIBCRYPTO} --LDADD= -lssl -lcrypto -+DPADD= ${LIBSSL} ${LIBCRYPTO} /usr/lib/liblockfile.a -+LDADD= -lssl -lcrypto -llockfile - - PROG= dma - SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c --- a/local.c +++ b/local.c @@ -7,8 +7,53 @@ @@ -173,3 +157,16 @@ Last-Update: 2010-06-02 close(mbox); return (error); } +--- a/Makefile.plain ++++ b/Makefile.plain +@@ -6,7 +6,9 @@ + + CC?= gcc + CFLAGS?= -O -pipe +-LDADD?= -lssl -lcrypto -lresolv ++LDADD?= -lssl -lcrypto -lresolv -llockfile ++ ++CFLAGS+= -DHAVE_LIBLOCKFILE + + INSTALL?= install -p + PREFIX?= /usr/local diff --git a/patches/11-double-bounce.patch b/patches/11-double-bounce.patch index 9094ac4..05fd51d 100644 --- a/patches/11-double-bounce.patch +++ b/patches/11-double-bounce.patch @@ -8,21 +8,19 @@ Description: Implement double-bounce handling via an external program. Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Bug: http://bugs.dragonflybsd.org/issue1321 Author: Peter Pentchev -Last-Update: 2010-06-17 +Last-Update: 2010-06-18 --- a/conf.c +++ b/conf.c -@@ -236,6 +236,10 @@ - if (data != NULL) - config->certfile = strdup(data); - } -+ else if (strcmp(word, "DBOUNCEPROG") == 0) { -+ if (data != NULL) -+ config->dbounceprog = strdup(data); -+ } - else if (strcmp(word, "MAILNAME") == 0) { - if (data != NULL) - config->mailname = strdup(data); +@@ -256,6 +256,8 @@ + config.authpath= data; + else if (strcmp(word, "CERTFILE") == 0 && data != NULL) + config.certfile = data; ++ else if (strcmp(word, "DBOUNCEPROG") == 0 && data != NULL) ++ config.dbounceprog = data; + else if (strcmp(word, "MAILNAME") == 0 && data != NULL) + config.mailname = data; + else if (strcmp(word, "MAILNAMEFILE") == 0 && data != NULL) --- a/dma.8 +++ b/dma.8 @@ -240,6 +240,26 @@ @@ -30,7 +28,7 @@ Last-Update: 2010-06-17 option. This option is handy if you are behind a dialup line. +.It Ic DBOUNCEPROG Xo -+(string, default=commented) ++(string, default=dbounce-simple-safecat) +.Xc +Comment if you want the default behavior of +.Nm @@ -52,18 +50,26 @@ Last-Update: 2010-06-17 .It Ic FULLBOUNCE Xo (boolean, default=commented) .Xc +@@ -270,6 +290,7 @@ + (e.g.\& user@localhost) so you have to rewrite your outgoing email + address to a valid address. + .Sh SEE ALSO ++.Xr dbounce-simple-safecat 1 , + .Xr mailaddr 7 , + .Xr mailwrapper 8 , + .Xr sendmail 8 --- a/dma.h +++ b/dma.h -@@ -120,6 +120,7 @@ - char *certfile; +@@ -111,6 +111,7 @@ + const char *authpath; + const char *certfile; int features; - SSL *ssl; -+ char *dbounceprog; - char *mailname; - char *mailnamefile; - }; ---- a/etc/dma.conf -+++ b/etc/dma.conf ++ const char *dbounceprog; + const char *mailname; + const char *mailnamefile; + +--- a/dma.conf ++++ b/dma.conf @@ -43,6 +43,12 @@ # behind a dialup line. You have to submit your mails manually with dma -q DEFER @@ -112,7 +118,7 @@ Last-Update: 2010-06-17 - exit(1); + syslog(LOG_INFO, "%s: bounce delivery failed, double-bouncing", + it->queueid); -+ if (config->dbounceprog == NULL) { ++ if (config.dbounceprog == NULL) { + syslog(LOG_CRIT, "%s: delivery panic: can't bounce a bounce and no double-bounce program defined in the config file", + it->queueid); + exit(1); @@ -140,10 +146,10 @@ Last-Update: 2010-06-17 + dup2(pipefd[1], STDIN_FILENO); + dup2(pipefd[1], STDOUT_FILENO); + dup2(pipefd[1], STDERR_FILENO); -+ execlp(config->dbounceprog, config->dbounceprog, ++ execlp(config.dbounceprog, config.dbounceprog, + "-t", "dma", "-a", it->addr, "-i", it->queueid, + "-f", it->queuefn, NULL); -+ err(1, "Could not execute %s", config->dbounceprog); ++ err(1, "Could not execute %s", config.dbounceprog); + /* NOTREACHED */ + } + @@ -204,7 +210,7 @@ Last-Update: 2010-06-17 + exit(1); + } + syslog(LOG_ERR, "%s: double-bounce succeeded, message passed to handler `%s': %s", -+ it->queueid, config->dbounceprog, buf); ++ it->queueid, config.dbounceprog, buf); + delqueue(it); + exit(0); } diff --git a/patches/17-mailname.patch b/patches/17-mailname.patch index ab5b2af..606b6ce 100644 --- a/patches/17-mailname.patch +++ b/patches/17-mailname.patch @@ -8,8 +8,8 @@ Forwarded: no Author: Peter Pentchev Last-Update: 2010-06-02 ---- a/etc/dma.conf -+++ b/etc/dma.conf +--- a/dma.conf ++++ b/dma.conf @@ -59,4 +59,4 @@ # The name of the file to read the MAILNAME from; if this file is not diff --git a/patches/24-random-message-id.patch b/patches/24-random-message-id.patch index 7506b2b..84e0893 100644 --- a/patches/24-random-message-id.patch +++ b/patches/24-random-message-id.patch @@ -4,21 +4,11 @@ Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Bug-Debian: http://bugs.debian.org/544475 Forwarded: no Author: Peter Pentchev -Last-Update: 2010-06-02 +Last-Update: 2010-06-18 ---- a/Makefile -+++ b/Makefile -@@ -3,6 +3,7 @@ - - SUBDIR= etc - -+CFLAGS+= -DHAVE_RANDOM - CFLAGS+= -DHAVE_LIBLOCKFILE - CFLAGS+= -I${.CURDIR} - --- a/dma.c +++ b/dma.c -@@ -356,6 +356,15 @@ +@@ -375,6 +375,15 @@ bzero(&queue, sizeof(queue)); LIST_INIT(&queue.queue); @@ -44,7 +34,7 @@ Last-Update: 2010-06-02 #include #include #include -@@ -514,8 +515,15 @@ +@@ -513,8 +514,15 @@ } else if (!had_messagid) { /* XXX better msgid, assign earlier and log? */ had_messagid = 1; @@ -62,3 +52,13 @@ Last-Update: 2010-06-02 } else if (!had_from) { had_from = 1; snprintf(line, sizeof(line), "From: <%s>\n", queue->sender); +--- a/Makefile.plain ++++ b/Makefile.plain +@@ -8,6 +8,7 @@ + CFLAGS?= -O -pipe + LDADD?= -lssl -lcrypto -lresolv -llockfile + ++CFLAGS+= -DHAVE_RANDOM -DHAVE_SRANDOM + CFLAGS+= -DHAVE_LIBLOCKFILE + + INSTALL?= install -p diff --git a/patches/25-unsupported-starttls.patch b/patches/25-unsupported-starttls.patch index ab41534..b117796 100644 --- a/patches/25-unsupported-starttls.patch +++ b/patches/25-unsupported-starttls.patch @@ -6,34 +6,34 @@ Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Bug-Debian: http://bugs.debian.org/547594 Forwarded: no Author: Peter Pentchev -Last-Update: 2010-06-02 +Last-Update: 2010-06-18 --- a/net.c +++ b/net.c -@@ -329,12 +329,12 @@ +@@ -304,12 +304,12 @@ static void close_connection(int fd) { -- if (((config->features & SECURETRANS) != 0) && -- ((config->features & NOSSL) == 0)) -- SSL_shutdown(config->ssl); +- if (((config.features & SECURETRANS) != 0) && +- ((config.features & NOSSL) == 0)) +- SSL_shutdown(config.ssl); - -- if (config->ssl != NULL) -+ if (config->ssl != NULL) { -+ if (((config->features & SECURETRANS) != 0) && -+ ((config->features & NOSSL) == 0)) -+ SSL_shutdown(config->ssl); - SSL_free(config->ssl); +- if (config.ssl != NULL) ++ if (config.ssl != NULL) { ++ if (((config.features & SECURETRANS) != 0) && ++ ((config.features & NOSSL) == 0)) ++ SSL_shutdown(config.ssl); + SSL_free(config.ssl); + } close(fd); } -@@ -387,7 +387,7 @@ +@@ -353,7 +353,7 @@ - if ((config->features & SECURETRANS) != 0) { - error = smtp_init_crypto(fd, config->features); -- if (error >= 0) -+ if (error == 0) + if ((config.features & SECURETRANS) != 0) { + error = smtp_init_crypto(fd, config.features); +- if (error == 0) ++ if (error >= 0) syslog(LOG_DEBUG, "SSL initialization successful"); else goto out; diff --git a/patches/26-getprogname.patch b/patches/26-getprogname.patch deleted file mode 100644 index 8419038..0000000 --- a/patches/26-getprogname.patch +++ /dev/null @@ -1,43 +0,0 @@ -Description: Use program_invocation_short_name() instead of getprogname(). -Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ -Forwarded: not-needed -Author: Peter Pentchev -Last-Update: 2010-06-03 - ---- a/util.c -+++ b/util.c -@@ -32,6 +32,8 @@ - * SUCH DAMAGE. - */ - -+#define _GNU_SOURCE -+ - #include - #include - #include -@@ -121,10 +123,10 @@ - - if (outs != NULL) { - syslog(LOG_ERR, "%s: %m", outs); -- fprintf(stderr, "%s: %s: %s\n", getprogname(), outs, strerror(oerrno)); -+ fprintf(stderr, "%s: %s: %s\n", program_invocation_short_name, outs, strerror(oerrno)); - } else { - syslog(LOG_ERR, "%m"); -- fprintf(stderr, "%s: %s\n", getprogname(), strerror(oerrno)); -+ fprintf(stderr, "%s: %s\n", program_invocation_short_name, strerror(oerrno)); - } - - exit(exitcode); -@@ -145,10 +147,10 @@ - - if (outs != NULL) { - syslog(LOG_ERR, "%s", outs); -- fprintf(stderr, "%s: %s\n", getprogname(), outs); -+ fprintf(stderr, "%s: %s\n", program_invocation_short_name, outs); - } else { - syslog(LOG_ERR, "Unknown error"); -- fprintf(stderr, "%s: Unknown error\n", getprogname()); -+ fprintf(stderr, "%s: Unknown error\n", program_invocation_short_name); - } - - exit(exitcode); diff --git a/patches/30-empty-sender.patch b/patches/30-empty-sender.patch deleted file mode 100644 index a514856..0000000 --- a/patches/30-empty-sender.patch +++ /dev/null @@ -1,22 +0,0 @@ -Description: Allow an empty queue file field - only if it is the sender. - I'll forward this patch as soon as I catch up with the dma upstream. -Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ -Forwarded: no -Author: Peter Pentchev -Last-Update: 2010-06-17 - ---- a/spool.c -+++ b/spool.c -@@ -171,9 +171,11 @@ - s++; - while (isspace(*s)) - s++; -+ if (s[0] == 0 && strcmp(line, "Sender") != 0) -+ goto malformed; - - s = strdup(s); -- if (s == NULL || s[0] == 0) -+ if (s == NULL) - goto malformed; - - if (strcmp(line, "ID") == 0) { diff --git a/patches/series b/patches/series index 61130ed..09c3705 100644 --- a/patches/series +++ b/patches/series @@ -1,6 +1,5 @@ 01-debian-build.patch 03-debian-locations.patch -04-debian-setgid.patch 09-typos.patch 10-liblockfile.patch 11-double-bounce.patch @@ -9,8 +8,6 @@ 23-dirent-d_type.patch 24-random-message-id.patch 25-unsupported-starttls.patch -26-getprogname.patch 27-int-size.patch 28-valid-recipient.patch 29-double-free.patch -30-empty-sender.patch