From: Simon Schubert Date: Thu, 16 Jul 2009 10:10:51 +0000 (+0200) Subject: dma: implement alternate identity for mailq X-Git-Url: https://gitweb.dragonflybsd.org/~corecode/dragonfly.git/commitdiff_plain/eb8700811f4fa825ca5d1ee92b744b0fe2170efa dma: implement alternate identity for mailq mailq does not take the standard sendmail options, but behaves like -bp. --- diff --git a/libexec/dma/dma.c b/libexec/dma/dma.c index dbb93baceb..ef0639aff8 100644 --- a/libexec/dma/dma.c +++ b/libexec/dma/dma.c @@ -1024,6 +1024,14 @@ main(int argc, char **argv) LIST_INIT(&queue.queue); snprintf(tag, 254, "dma"); + if (strcmp(argv[0], "mailq") == 0) { + argv++; argc--; + showq = 1; + if (argc != 0) + errx(1, "invalid arguments"); + goto skipopts; + } + opterr = 0; while ((ch = getopt(argc, argv, "A:b:B:C:d:Df:F:h:iL:N:no:O:q:r:R:UV:vX:")) != -1) { switch (ch) { @@ -1090,6 +1098,7 @@ main(int argc, char **argv) argv += optind; opterr = 1; +skipopts: openlog(tag, LOG_PID, LOG_MAIL); set_username();