From: Simon Schubert Date: Thu, 27 Aug 2009 15:08:49 +0000 (+0200) Subject: dma: add queue-only mode (no instant delivery attempt) X-Git-Url: https://gitweb.dragonflybsd.org/~polachok/dragonfly.git/commitdiff_plain/a9337db729d5be8db3476547520fbb99f67ebad6 dma: add queue-only mode (no instant delivery attempt) This acts like the DEFER config option, just from the command line. --- diff --git a/libexec/dma/dma.8 b/libexec/dma/dma.8 index bb178bcdc8..49c4f5ef0a 100644 --- a/libexec/dma/dma.8 +++ b/libexec/dma/dma.8 @@ -71,10 +71,19 @@ The options are as follows: .Fl A Ns Ar c acts as a compatibility option for sendmail. .It Fl b Ar mode -Specifying -.Fl b Ns Ar p -will list all mails currently stored in the mail queue. -All other modes are are ignored. +.Bl -tag -width indent +.It Fl bp +List all mails currently stored in the mail queue. +.It Fl bq +Queue the mail, but don't attempt to deliver it. +See also the +.Sq DEFER +config file setting below. +.El +.Pp +All other +.Ar mode Ns +s are are ignored. .It Fl D Don't run in the background. Useful for debugging. diff --git a/libexec/dma/dma.c b/libexec/dma/dma.c index 037288a900..dde31ca4f0 100644 --- a/libexec/dma/dma.c +++ b/libexec/dma/dma.c @@ -347,7 +347,7 @@ main(int argc, char **argv) char *sender = NULL; struct queue queue; int i, ch; - int nodot = 0, doqueue = 0, showq = 0; + int nodot = 0, doqueue = 0, showq = 0, queue_only = 0; atexit(deltmp); @@ -376,6 +376,9 @@ main(int argc, char **argv) if (optarg[0] == 'p') { showq = 1; break; + } else if (optarg[0] == 'q') { + queue_only = 1; + break; } /* else FALLTRHOUGH */ case 'D': @@ -507,7 +510,7 @@ skipopts: /* From here on the mail is safe. */ - if (config->features & DEFER) + if (config->features & DEFER || queue_only) return (0); run_queue(&queue);