commit 717c83de225a97142498c75854e7648369da6597
parent 678c3fc4750290caeba9d4c49c99fb8f779ede34
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Mon, 4 Apr 2022 14:34:09 +0000
Keep mail on server after retrieval by default
Diffstat:
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/pop3.1 b/pop3.1
@@ -1,4 +1,4 @@
-.\" $Id: pop3.1,v 1.4 2022/04/03 17:55:56 jacob Exp $
+.\" $Id: pop3.1,v 1.5 2022/04/04 14:34:09 jacob Exp $
.\"
.\" Copyright (c) 2022 Jacob R. Edwards
.\"
@@ -22,7 +22,7 @@
.Nd fetch mail from POP3 server
.Sh SYNOPSIS
.Nm
-.Op Fl kqstv
+.Op Fl dqstv
.Op Fl m Ar mailer
.Op Fl p Ar port
.Op Fl u Ar user
@@ -38,8 +38,8 @@ before use.
.Pp
The options are as follows:
.Bl -tag -width Ds
-.It Fl k
-Don't delete mail after retreiving it.
+.It Fl d
+Delete mail after retreiving it.
.It Fl q
Query maildrop statistics. Output is of the form:
.Bd -literal -offset indent -compact
diff --git a/pop3.c b/pop3.c
@@ -1,4 +1,4 @@
-/* $Id: pop3.c,v 1.3 2022/04/03 17:55:56 jacob Exp $ */
+/* $Id: pop3.c,v 1.4 2022/04/04 14:34:09 jacob Exp $ */
/*
* Copyright (c) 2022 Jacob R. Edwards
@@ -49,7 +49,7 @@ static char poperr[128];
static int gaierr;
/* Flag variables */
-static int keep;
+static int delete;
static int query;
static int usestdin;
static int trace;
@@ -92,7 +92,7 @@ usage(char *why)
{
if (why)
fprintf(stderr, "%s\n", why);
- fprintf(stderr, "usage: %s [-kqst] [-m mailer] [-p port] [-u user] host\n",
+ fprintf(stderr, "usage: %s [-dqstv] [-m mailer] [-p port] [-u user] host\n",
getprogname());
exit(1);
}
@@ -496,10 +496,10 @@ main(int argc, char *argv[])
die("pledge");
user = getlogin();
- while ((c = getopt(argc, argv, "km:p:qstu:v")) >= 0) {
+ while ((c = getopt(argc, argv, "dm:p:qstu:v")) >= 0) {
switch (c) {
- case 'k':
- keep = 1;
+ case 'd':
+ delete = 1;
break;
case 'm':
mailer = optarg;
@@ -549,7 +549,7 @@ main(int argc, char *argv[])
if (stat(fp, stdout))
die("unable to stat");
} else {
- if (getmail(fp, !keep, mailer))
+ if (getmail(fp, delete, mailer))
die("unable to get mail");
if (verbose && stat(fp, stderr))
die("unable to stat");