diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-08-20 16:36:05 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-08-20 16:36:05 +0000 |
commit | 2382c29e5fee8cb88a784e8ed6fb27dd46fb42af (patch) | |
tree | e7b37c4eb6845e4b5a1c541c335f0af9762f2d62 /contrib/dma | |
parent | 5b6123e31d972b83030672576ee8c7178a9335ed (diff) | |
parent | eb8bc5621c0e1eaeb75884f5d7f36edd90d4cd9b (diff) | |
download | src-2382c29e5fee8cb88a784e8ed6fb27dd46fb42af.tar.gz src-2382c29e5fee8cb88a784e8ed6fb27dd46fb42af.zip |
Notes
Diffstat (limited to 'contrib/dma')
-rw-r--r-- | contrib/dma/VERSION | 2 | ||||
-rw-r--r-- | contrib/dma/dma-mbox-create.c | 2 | ||||
-rw-r--r-- | contrib/dma/dma.c | 4 | ||||
-rw-r--r-- | contrib/dma/dma.h | 2 | ||||
-rw-r--r-- | contrib/dma/dns.c | 1 | ||||
-rw-r--r-- | contrib/dma/local.c | 2 | ||||
-rw-r--r-- | contrib/dma/net.c | 9 |
7 files changed, 13 insertions, 9 deletions
diff --git a/contrib/dma/VERSION b/contrib/dma/VERSION index 9097bf9dbe5f..5416288bc5ef 100644 --- a/contrib/dma/VERSION +++ b/contrib/dma/VERSION @@ -1 +1 @@ -v0.10 +v0.11 diff --git a/contrib/dma/dma-mbox-create.c b/contrib/dma/dma-mbox-create.c index 532a7afbe0b5..45a4792a3f6f 100644 --- a/contrib/dma/dma-mbox-create.c +++ b/contrib/dma/dma-mbox-create.c @@ -142,7 +142,7 @@ main(int argc, char **argv) logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user); } - f = open(fn, O_RDONLY|O_CREAT, 0600); + f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600); if (f < 0) logfail(EX_NOINPUT, "cannt open mbox `%s'", fn); diff --git a/contrib/dma/dma.c b/contrib/dma/dma.c index 684ab059111d..4f48f4845124 100644 --- a/contrib/dma/dma.c +++ b/contrib/dma/dma.c @@ -321,7 +321,7 @@ deliver(struct qitem *it) snprintf(errmsg, sizeof(errmsg), "unknown bounce reason"); retry: - syslog(LOG_INFO, "trying delivery"); + syslog(LOG_INFO, "<%s> trying delivery", it->addr); if (it->remote) error = deliver_remote(it); @@ -331,7 +331,7 @@ retry: switch (error) { case 0: delqueue(it); - syslog(LOG_INFO, "delivery successful"); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); exit(EX_OK); case 1: diff --git a/contrib/dma/dma.h b/contrib/dma/dma.h index acf5e44d07bc..593417617d3d 100644 --- a/contrib/dma/dma.h +++ b/contrib/dma/dma.h @@ -49,7 +49,7 @@ #define VERSION "DragonFly Mail Agent " DMA_VERSION #define BUF_SIZE 2048 -#define ERRMSG_SIZE 200 +#define ERRMSG_SIZE 1024 #define USERNAME_SIZE 50 #define MIN_RETRY 300 /* 5 minutes */ #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ diff --git a/contrib/dma/dns.c b/contrib/dma/dns.c index dd9ebfca8d82..bd28c4db724c 100644 --- a/contrib/dma/dns.c +++ b/contrib/dma/dns.c @@ -34,6 +34,7 @@ */ #include <sys/types.h> +#include <sys/param.h> #include <netinet/in.h> #include <arpa/inet.h> #include <arpa/nameser.h> diff --git a/contrib/dma/local.c b/contrib/dma/local.c index e3e015217fea..94e217928983 100644 --- a/contrib/dma/local.c +++ b/contrib/dma/local.c @@ -196,7 +196,7 @@ retry: goto out; } - error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, ctime(&now)); + error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, ctime(&now)); if (error < 0 || (size_t)error >= sizeof(line)) { syslog(LOG_NOTICE, "local delivery deferred: can not write header: %m"); goto out; diff --git a/contrib/dma/net.c b/contrib/dma/net.c index 26935a8feec8..47ee92849421 100644 --- a/contrib/dma/net.c +++ b/contrib/dma/net.c @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host) host->host, host->addr, c, neterr); \ snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \ host->host, host->addr, c, neterr); \ - return (-1); \ + error = -1; \ + goto out; \ } else if (res != exp) { \ syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \ host->host, host->addr, c, neterr); \ - return (1); \ + error = 1; \ + goto out; \ } /* Check first reply from remote host */ @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host) syslog(LOG_ERR, "remote delivery failed:" " SMTP login failed: %m"); snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host); - return (-1); + error = -1; + goto out; } /* SMTP login is not available, so try without */ else if (error > 0) { |