From: Simon Schubert Date: Thu, 16 Jul 2009 11:31:11 +0000 (+0200) Subject: dma: log mail queueing more thoroughly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84cb6e2ce5acdface690fd3815955df844cb89c;p=people%2Fms%2Fdma.git 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/dma.c b/dma.c index 2db8dcd..bd29be9 100644 --- a/dma.c +++ b/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)