41 |
volatile size_t children; |
volatile size_t children; |
42 |
/* Should all the messages be undeleted on startup */ |
/* Should all the messages be undeleted on startup */ |
43 |
int undelete_on_startup; |
int undelete_on_startup; |
44 |
|
#ifdef ENABLE_LOGIN_DELAY |
45 |
|
/* Minimum allowed delay between two successive logins */ |
46 |
|
time_t login_delay = 0; |
47 |
|
char *login_stat_file = LOGIN_STAT_FILE; |
48 |
|
#endif |
49 |
|
|
50 |
static int pop3d_mainloop __P ((int fd, FILE *, FILE *)); |
static int pop3d_mainloop __P ((int fd, FILE *, FILE *)); |
51 |
static void pop3d_daemon_init __P ((void)); |
static void pop3d_daemon_init __P ((void)); |
57 |
const char *program_version = "pop3d (" PACKAGE_STRING ")"; |
const char *program_version = "pop3d (" PACKAGE_STRING ")"; |
58 |
static char doc[] = N_("GNU pop3d -- the POP3 daemon"); |
static char doc[] = N_("GNU pop3d -- the POP3 daemon"); |
59 |
|
|
60 |
|
#define OPT_LOGIN_DELAY 257 |
61 |
|
#define OPT_STAT_FILE 258 |
62 |
|
|
63 |
static struct argp_option options[] = { |
static struct argp_option options[] = { |
64 |
{"undelete", 'u', NULL, 0, |
{"undelete", 'u', NULL, 0, |
65 |
N_("undelete all messages on startup"), 0}, |
N_("Undelete all messages on startup"), 0}, |
66 |
|
#ifdef ENABLE_LOGIN_DELAY |
67 |
|
{"login-delay", OPT_LOGIN_DELAY, N_("SECONDS"), 0, |
68 |
|
N_("Allowed delay between the two successive logins"), 0}, |
69 |
|
{"stat-file", OPT_STAT_FILE, N_("FILENAME"), 0, |
70 |
|
N_("Name of login statistics file"), 0}, |
71 |
|
#endif |
72 |
{NULL, 0, NULL, 0, NULL, 0} |
{NULL, 0, NULL, 0, NULL, 0} |
73 |
}; |
}; |
74 |
|
|
97 |
static error_t |
static error_t |
98 |
pop3d_parse_opt (int key, char *arg, struct argp_state *astate) |
pop3d_parse_opt (int key, char *arg, struct argp_state *astate) |
99 |
{ |
{ |
100 |
|
char *p; |
101 |
|
|
102 |
switch (key) |
switch (key) |
103 |
{ |
{ |
104 |
case ARGP_KEY_INIT: |
case ARGP_KEY_INIT: |
108 |
case 'u': |
case 'u': |
109 |
undelete_on_startup = 1; |
undelete_on_startup = 1; |
110 |
break; |
break; |
111 |
|
|
112 |
|
#ifdef ENABLE_LOGIN_DELAY |
113 |
|
case OPT_LOGIN_DELAY: |
114 |
|
login_delay = strtoul (arg, &p, 10); |
115 |
|
if (*p) |
116 |
|
{ |
117 |
|
argp_error (state, _("Invalid number")); |
118 |
|
exit (1); |
119 |
|
} |
120 |
|
break; |
121 |
|
|
122 |
|
case OPT_STAT_FILE: |
123 |
|
login_stat_file = arg; |
124 |
|
break; |
125 |
|
|
126 |
|
#endif |
127 |
default: |
default: |
128 |
return ARGP_ERR_UNKNOWN; |
return ARGP_ERR_UNKNOWN; |
129 |
} |
} |
425 |
else if (status == ERR_TLS_ACTIVE) |
else if (status == ERR_TLS_ACTIVE) |
426 |
pop3d_outf ("-ERR " TLS_ACTIVE "\r\n"); |
pop3d_outf ("-ERR " TLS_ACTIVE "\r\n"); |
427 |
#endif /* WITH_TLS */ |
#endif /* WITH_TLS */ |
428 |
|
else if (status == ERR_LOGIN_DELAY) |
429 |
|
pop3d_outf ("-ERR [LOGIN-DELAY] " LOGIN_DELAY "\r\n"); |
430 |
else |
else |
431 |
pop3d_outf ("-ERR unknown error\r\n"); |
pop3d_outf ("-ERR unknown error\r\n"); |
432 |
|
|