summaryrefslogtreecommitdiff
path: root/pop3d/pop3d.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-11-15 16:35:10 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-11-15 16:35:10 +0000
commit1103d9e6e6eed5a15522a7fad0f6fd160394c7bf (patch)
tree93826f4779a95fd7d0c31e67c70ce518e9b7744f /pop3d/pop3d.c
parent969a33e168c8de2888274cfc4674caca85feb6c9 (diff)
downloadmailutils-1103d9e6e6eed5a15522a7fad0f6fd160394c7bf.tar.gz
mailutils-1103d9e6e6eed5a15522a7fad0f6fd160394c7bf.tar.bz2
New option --tls-required: do not allow
authentication until TLS negotiation succeeds. New option --delete-expired: delete expired messages before closing the mailbox.
Diffstat (limited to 'pop3d/pop3d.c')
-rw-r--r--pop3d/pop3d.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c
index 87e18f04d..9654286d7 100644
--- a/pop3d/pop3d.c
+++ b/pop3d/pop3d.c
@@ -38,8 +38,10 @@ int tls_available;
int tls_done;
#endif /* WITH_TLS */
+int initial_state = AUTHORIZATION;
+
/* Number of child processes. */
-volatile size_t children;
+size_t children;
/* Should all the messages be undeleted on startup */
int undelete_on_startup;
#ifdef ENABLE_LOGIN_DELAY
@@ -48,8 +50,8 @@ time_t login_delay = 0;
char *login_stat_file = LOGIN_STAT_FILE;
#endif
-/* Minimum advertise retention times of messages. */
-int expire = -1;
+time_t expire = EXPIRE_NEVER; /* Expire messages after this number of days */
+int expire_on_exit = 0; /* Delete expired messages on exit */
static int pop3d_mainloop __P ((int fd, FILE *, FILE *));
static void pop3d_daemon_init __P ((void));
@@ -61,9 +63,11 @@ static void pop3d_log_connection __P((int fd));
const char *program_version = "pop3d (" PACKAGE_STRING ")";
static char doc[] = N_("GNU pop3d -- the POP3 daemon");
-#define OPT_LOGIN_DELAY 257
-#define OPT_STAT_FILE 258
-#define OPT_EXPIRE 259
+#define OPT_LOGIN_DELAY 257
+#define OPT_STAT_FILE 258
+#define OPT_EXPIRE 259
+#define OPT_EXPIRE_ON_EXIT 260
+#define OPT_TLS_REQUIRED 261
static struct argp_option options[] = {
{"undelete", 'u', NULL, 0,
@@ -75,7 +79,13 @@ static struct argp_option options[] = {
N_("Name of login statistics file"), 0},
#endif
{"expire", OPT_EXPIRE, N_("DAYS"), 0,
- N_("Maximum retention period for messages in the maildrop, default -1 means NEVER"), 0},
+ N_("Expire read messages after the given number of days"), 0},
+ {"delete-expired", OPT_EXPIRE_ON_EXIT, NULL, 0,
+ N_("Delete expired messages upon closing the mailbox"), 0},
+#ifdef WITH_TLS
+ {"tls-required", OPT_TLS_REQUIRED, NULL, 0,
+ N_("Always require STLS before entering authentication phase")},
+#endif
{NULL, 0, NULL, 0, NULL, 0}
};
@@ -139,6 +149,16 @@ pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
exit (1);
}
break;
+
+ case OPT_EXPIRE_ON_EXIT:
+ expire_on_exit = 1;
+ break;
+
+#ifdef WITH_TLS
+ case OPT_TLS_REQUIRED:
+ initial_state = INITIAL;
+ break;
+#endif
default:
return ARGP_ERR_UNKNOWN;
@@ -165,7 +185,7 @@ main (int argc, char **argv)
#ifdef USE_LIBPAM
if (!pam_service)
- pam_service = (char *)"gnu-pop3d";
+ pam_service = "gnu-pop3d";
#endif
if (daemon_param.mode == MODE_INTERACTIVE && isatty (0))
@@ -313,7 +333,7 @@ pop3d_mainloop (int fd, FILE *infile, FILE *outfile)
pop3d_setio (infile, outfile);
- state = AUTHORIZATION;
+ state = initial_state;
pop3d_log_connection (fd);

Return to:

Send suggestions and report system problems to the System administrator.