aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-19 16:59:19 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-19 16:59:19 +0200
commitce625878de93a1388ae94dd21f5644f63152e299 (patch)
tree5ead1f27eb15e52ab8f2eb9fe001fc03627267da
parent2cb93984a1a9cd50b3b27e9cfa7e4c31e8c319d7 (diff)
downloadmblaze-ce625878de93a1388ae94dd21f5644f63152e299.tar.gz
mdeliver: deliver to new/ by default, use -c for cur/ now
-rw-r--r--man/mdeliver.110
-rw-r--r--mdeliver.c13
2 files changed, 11 insertions, 12 deletions
diff --git a/man/mdeliver.1 b/man/mdeliver.1
index 3df357c..11ac172 100644
--- a/man/mdeliver.1
+++ b/man/mdeliver.1
@@ -6,7 +6,7 @@
.Nd deliver message or mailbox into Maildir
.Sh SYNOPSIS
.Nm
-.Op Fl n
+.Op Fl c
.Op Fl v
.Op Fl X Ar flags
.Ar dir
@@ -14,7 +14,7 @@
.Ar message
.Nm
.Fl M
-.Op Fl n
+.Op Fl c
.Op Fl v
.Op Fl X Ar flags
.Ar dir
@@ -54,11 +54,11 @@ The options are as follows:
.Bl -tag -width Ds
.It Fl M
Deliver each message of an mbox.
-.It Fl n
+.It Fl c
Deliver messages into
-.Pa new/ ,
+.Pa cur/ ,
not
-.Pa cur/
+.Pa new/
(the default).
.It Fl v
Print each message filename after delivery.
diff --git a/mdeliver.c b/mdeliver.c
index fd0c860..c6311f3 100644
--- a/mdeliver.c
+++ b/mdeliver.c
@@ -19,12 +19,11 @@ design rationale:
MBOX-O fine
- date from Date: since From lines are usually crap
- proper maildir delivery because it's not that hard
-- messages end up in cur/ by default because you are usually importing archives
- no creation of maildirs, should be a separate tool
*/
+static int cflag;
static int Mflag;
-static int nflag;
static int vflag;
static char *Xflag;
@@ -156,7 +155,7 @@ tryagain:
*f = 0;
snprintf(dst, sizeof dst, "%s/%s/%s:2,%s",
- targetdir, nflag ? "new" : "cur", id,
+ targetdir, cflag ? "cur" : "new", id,
Xflag ? Xflag : statusflags);
if (rename(tmp, dst) != 0)
return -1;
@@ -171,16 +170,16 @@ int
main(int argc, char *argv[])
{
int c;
- while ((c = getopt(argc, argv, "MnvX:")) != -1)
+ while ((c = getopt(argc, argv, "cMvX:")) != -1)
switch(c) {
+ case 'c': cflag = 1; break;
case 'M': Mflag = 1; break;
- case 'n': nflag = 1; break;
case 'v': vflag = 1; break;
case 'X': Xflag = optarg; break;
default:
fprintf(stderr,
-"Usage: mdeliver [-n] [-v] [-X flags] dir < message\n"
-" mdeliver -M [-n] [-v] [-X flags] dir < mbox\n"
+"Usage: mdeliver [-c] [-v] [-X flags] dir < message\n"
+" mdeliver -M [-c] [-v] [-X flags] dir < mbox\n"
);
exit(1);
}