Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
3d8702be
...
3d8702be62bddafeef5019362cc4d7751e7c409f
authored
2002-01-15 21:51:39 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New command line option --maildir (-m). Register mbox_record at startup.
1 parent
4ca73737
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
imap4d/imap4d.c
pop3d/pop3d.c
imap4d/imap4d.c
View file @
3d8702b
...
...
@@ -25,6 +25,7 @@ FILE *ofile;
unsigned
int
timeout
=
1800
;
/* RFC2060: 30 minutes, if enable. */
mailbox_t
mbox
;
char
*
homedir
;
char
*
maildir
=
_PATH_MAILDIR
;
int
state
=
STATE_NONAUTH
;
/* Number of child processes. */
...
...
@@ -35,6 +36,7 @@ static struct option long_options[] =
{
"daemon"
,
optional_argument
,
0
,
'd'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
"inetd"
,
no_argument
,
0
,
'i'
},
{
"maildir"
,
required_argument
,
0
,
'm'
},
{
"port"
,
required_argument
,
0
,
'p'
},
{
"other-namespace"
,
required_argument
,
0
,
'O'
},
{
"shared-namespace"
,
required_argument
,
0
,
'S'
},
...
...
@@ -43,7 +45,7 @@ static struct option long_options[] =
{
0
,
0
,
0
,
0
}
};
const
char
*
short_options
=
"d::hip:t:vO:P:S:"
;
const
char
*
short_options
=
"d::hi
m:
p:t:vO:P:S:"
;
static
int
imap4d_mainloop
__P
((
int
,
int
));
static
void
imap4d_daemon_init
__P
((
void
));
...
...
@@ -90,6 +92,10 @@ main (int argc, char **argv)
mode
=
INTERACTIVE
;
break
;
case
'm'
:
maildir
=
optarg
;
break
;
case
'p'
:
mode
=
DAEMON
;
port
=
strtoul
(
optarg
,
NULL
,
10
);
...
...
@@ -117,6 +123,13 @@ main (int argc, char **argv)
}
}
maildir
=
mu_normalize_maildir
(
maildir
);
if
(
!
maildir
)
{
mu_error
(
"Badly formed maildir: %s"
,
maildir
);
exit
(
1
);
}
/* First we want our group to be mail so we can access the spool. */
gr
=
getgrnam
(
"mail"
);
if
(
gr
==
NULL
)
...
...
@@ -135,7 +148,7 @@ main (int argc, char **argv)
{
list_t
bookie
;
registrar_get_list
(
&
bookie
);
/* list_append (bookie, mbox_record); */
list_append
(
bookie
,
mbox_record
);
list_append
(
bookie
,
path_record
);
}
...
...
@@ -347,13 +360,18 @@ imap4d_usage (char *argv0)
{
printf
(
"Usage: %s [OPTIONS]
\n
"
,
argv0
);
printf
(
"Runs the GNU IMAP4 daemon.
\n\n
"
);
printf
(
" -d, --daemon
=MAXCHILDREN
runs in daemon mode with a maximum
\n
"
);
printf
(
" -d, --daemon
[=MAXCHILDREN]
runs in daemon mode with a maximum
\n
"
);
printf
(
" of MAXCHILDREN child processes
\n
"
);
printf
(
" MAXCHILDREN defaults to %d
\n
"
,
DEFMAXCHILDREN
);
printf
(
" -h, --help display this help and exit
\n
"
);
printf
(
" -i, --inetd runs in inetd mode (default)
\n
"
);
printf
(
" -p, --port=PORT specifies port to listen on, implies -d
\n
"
);
printf
(
" defaults to 143, which need not be specified
\n
"
);
printf
(
" -m, --maildir=PATH set path to the mailspool directory
\n
"
);
printf
(
" -O, --other-namespace=PATHLIST sets the `other' namespace
\n
"
);
printf
(
" -S, --shared-namespace=PATHLIST sets the `shared' namespace
\n
"
);
printf
(
" -t, --timeout=TIMEOUT sets idle timeout to TIMEOUT seconds
\n
"
);
printf
(
" TIMEOUT default is 1800 (30 minutes)
\n
"
);
printf
(
" -v, --version display version information and exit
\n
"
);
...
...
pop3d/pop3d.c
View file @
3d8702b
...
...
@@ -25,6 +25,7 @@ mailbox_t mbox;
unsigned
int
timeout
;
int
state
;
char
*
username
;
char
*
maildir
=
_PATH_MAILDIR
;
FILE
*
ifile
;
FILE
*
ofile
;
char
*
md5shared
;
...
...
@@ -36,13 +37,14 @@ static struct option long_options[] =
{
"daemon"
,
optional_argument
,
0
,
'd'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
"inetd"
,
no_argument
,
0
,
'i'
},
{
"maildir"
,
required_argument
,
0
,
'm'
},
{
"port"
,
required_argument
,
0
,
'p'
},
{
"timeout"
,
required_argument
,
0
,
't'
},
{
"version"
,
no_argument
,
0
,
'v'
},
{
0
,
0
,
0
,
0
}
};
const
char
*
short_options
=
"d::hip:t:v"
;
const
char
*
short_options
=
"d::hi
m:
p:t:v"
;
static
int
pop3d_mainloop
__P
((
int
,
int
));
static
void
pop3d_daemon_init
__P
((
void
));
...
...
@@ -87,6 +89,10 @@ main (int argc, char **argv)
mode
=
INTERACTIVE
;
break
;
case
'm'
:
maildir
=
optarg
;
break
;
case
'p'
:
mode
=
DAEMON
;
port
=
strtoul
(
optarg
,
NULL
,
10
);
...
...
@@ -106,6 +112,13 @@ main (int argc, char **argv)
}
}
maildir
=
mu_normalize_maildir
(
maildir
);
if
(
!
maildir
)
{
mu_error
(
"Badly formed maildir: %s"
,
maildir
);
exit
(
1
);
}
/* First we want our group to be mail so we can access the spool. */
gr
=
getgrnam
(
"mail"
);
if
(
gr
==
NULL
)
...
...
@@ -124,7 +137,7 @@ main (int argc, char **argv)
{
list_t
bookie
;
registrar_get_list
(
&
bookie
);
/* list_append (bookie, mbox_record); */
list_append
(
bookie
,
mbox_record
);
list_append
(
bookie
,
path_record
);
}
...
...
@@ -449,6 +462,7 @@ pop3d_usage (char *argv0)
printf
(
" of MAXCHILDREN child processes
\n
"
);
printf
(
" -h, --help display this help and exit
\n
"
);
printf
(
" -i, --inetd runs in inetd mode (default)
\n
"
);
printf
(
" -m, --maildir=PATH sets path to the mailspool directory
\n
"
);
printf
(
" -p, --port=PORT specifies port to listen on, implies -d
\n
"
);
printf
(
" defaults to 110, which need not be specified
\n
"
);
...
...
Please
register
or
sign in
to post a comment