25 |
unsigned int timeout; |
unsigned int timeout; |
26 |
int state; |
int state; |
27 |
char *username; |
char *username; |
28 |
|
char *maildir = _PATH_MAILDIR; |
29 |
FILE *ifile; |
FILE *ifile; |
30 |
FILE *ofile; |
FILE *ofile; |
31 |
char *md5shared; |
char *md5shared; |
37 |
{"daemon", optional_argument, 0, 'd'}, |
{"daemon", optional_argument, 0, 'd'}, |
38 |
{"help", no_argument, 0, 'h'}, |
{"help", no_argument, 0, 'h'}, |
39 |
{"inetd", no_argument, 0, 'i'}, |
{"inetd", no_argument, 0, 'i'}, |
40 |
|
{"maildir", required_argument, 0, 'm'}, |
41 |
{"port", required_argument, 0, 'p'}, |
{"port", required_argument, 0, 'p'}, |
42 |
{"timeout", required_argument, 0, 't'}, |
{"timeout", required_argument, 0, 't'}, |
43 |
{"version", no_argument, 0, 'v'}, |
{"version", no_argument, 0, 'v'}, |
44 |
{0, 0, 0, 0} |
{0, 0, 0, 0} |
45 |
}; |
}; |
46 |
|
|
47 |
const char *short_options = "d::hip:t:v"; |
const char *short_options = "d::him:p:t:v"; |
48 |
|
|
49 |
static int pop3d_mainloop __P ((int, int)); |
static int pop3d_mainloop __P ((int, int)); |
50 |
static void pop3d_daemon_init __P ((void)); |
static void pop3d_daemon_init __P ((void)); |
64 |
int c = 0; |
int c = 0; |
65 |
int status = OK; |
int status = OK; |
66 |
unsigned int port; |
unsigned int port; |
67 |
|
|
68 |
port = 110; /* Default POP3 port. */ |
port = 110; /* Default POP3 port. */ |
69 |
timeout = 600; /* Default timeout of 600. */ |
timeout = 600; /* Default timeout of 600. */ |
70 |
|
|
89 |
mode = INTERACTIVE; |
mode = INTERACTIVE; |
90 |
break; |
break; |
91 |
|
|
92 |
|
case 'm': |
93 |
|
maildir = optarg; |
94 |
|
break; |
95 |
|
|
96 |
case 'p': |
case 'p': |
97 |
mode = DAEMON; |
mode = DAEMON; |
98 |
port = strtoul (optarg, NULL, 10); |
port = strtoul (optarg, NULL, 10); |
112 |
} |
} |
113 |
} |
} |
114 |
|
|
115 |
|
maildir = mu_normalize_maildir (maildir); |
116 |
|
if (!maildir) |
117 |
|
{ |
118 |
|
mu_error ("Badly formed maildir: %s", maildir); |
119 |
|
exit (1); |
120 |
|
} |
121 |
|
|
122 |
/* First we want our group to be mail so we can access the spool. */ |
/* First we want our group to be mail so we can access the spool. */ |
123 |
gr = getgrnam ("mail"); |
gr = getgrnam ("mail"); |
124 |
if (gr == NULL) |
if (gr == NULL) |
137 |
{ |
{ |
138 |
list_t bookie; |
list_t bookie; |
139 |
registrar_get_list (&bookie); |
registrar_get_list (&bookie); |
140 |
/* list_append (bookie, mbox_record); */ |
list_append (bookie, mbox_record); |
141 |
list_append (bookie, path_record); |
list_append (bookie, path_record); |
142 |
} |
} |
143 |
|
|
462 |
printf (" of MAXCHILDREN child processes\n"); |
printf (" of MAXCHILDREN child processes\n"); |
463 |
printf (" -h, --help display this help and exit\n"); |
printf (" -h, --help display this help and exit\n"); |
464 |
printf (" -i, --inetd runs in inetd mode (default)\n"); |
printf (" -i, --inetd runs in inetd mode (default)\n"); |
465 |
|
printf (" -m, --maildir=PATH sets path to the mailspool directory\n"); |
466 |
printf (" -p, --port=PORT specifies port to listen on, implies -d\n" |
printf (" -p, --port=PORT specifies port to listen on, implies -d\n" |
467 |
); |
); |
468 |
printf (" defaults to 110, which need not be specified\n"); |
printf (" defaults to 110, which need not be specified\n"); |