From: Simon Schubert Date: Thu, 16 Jul 2009 11:31:11 +0000 (+0200) Subject: dma: log mail queueing more thoroughly X-Git-Tag: v2.4.0~414^2~10 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/69a73aeb37bdc0b82d21beb3fa4862117ab83463 dma: log mail queueing more thoroughly Directly log when a mail is accepted and not only when a delivery attempt is made. --- diff --git a/libexec/dma/dma.c b/libexec/dma/dma.c index 2db8dcd549..bd29be9501 100644 --- a/libexec/dma/dma.c +++ b/libexec/dma/dma.c @@ -371,6 +371,10 @@ preparespool(struct queue *queue, const char *sender) if (fstat(queue->mailfd, &st) != 0) return (-1); queue->id = st.st_ino; + + syslog(LOG_INFO, "%"PRIxMAX": new mail from user=%s uid=%d envelope_from=<%s>", + queue->id, username, uid, sender); + LIST_FOREACH(it, &queue->queue, next) { if (asprintf(&it->queueid, "%"PRIxMAX".%"PRIxPTR, queue->id, (uintptr_t)it) <= 0) @@ -388,6 +392,9 @@ preparespool(struct queue *queue, const char *sender) return (-1); if (write(queue->mailfd, line, error) != error) return (-1); + + syslog(LOG_INFO, "%"PRIxMAX": mail to=<%s> queued as %s", + queue->id, it->addr, it->queueid); } line[0] = '\n'; if (write(queue->mailfd, line, 1) != 1)