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
425d200a
...
425d200a1eee0b7b279711de92c4dd061efd6033
authored
2002-02-27 11:54:01 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Provide better diagnostics.
1 parent
72d25ce5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
imap4d/status.c
imap4d/status.c
View file @
425d200
...
...
@@ -62,7 +62,8 @@ imap4d_status (struct imap4d_command *command, char *arg)
mailbox_t
smbox
=
NULL
;
int
status
;
int
count
=
0
;
char
*
err_msg
=
NULL
;
if
(
!
(
command
->
states
&
state
))
return
util_finish
(
command
,
RESP_BAD
,
"Wrong state"
);
...
...
@@ -76,13 +77,14 @@ imap4d_status (struct imap4d_command *command, char *arg)
struct
passwd
*
pw
=
mu_getpwuid
(
getuid
());
if
(
!
pw
)
return
util_finish
(
command
,
RESP_NO
,
"Cannot map UID to username"
);
mailbox_name
=
malloc
(
strlen
(
maildir
)
+
strlen
(
pw
->
pw_name
)
+
1
);
mailbox_name
=
malloc
(
strlen
(
mu_path_maildir
)
+
strlen
(
pw
->
pw_name
)
+
1
);
if
(
!
mailbox_name
)
{
syslog
(
LOG_ERR
,
"Not enough memory"
);
return
util_finish
(
command
,
RESP_NO
,
"Not enough memory"
);
}
sprintf
(
mailbox_name
,
"%s%s"
,
maildir
,
pw
->
pw_name
);
sprintf
(
mailbox_name
,
"%s%s"
,
m
u_path_m
aildir
,
pw
->
pw_name
);
}
else
mailbox_name
=
namespace_getfullpath
(
name
,
delim
);
...
...
@@ -113,7 +115,7 @@ imap4d_status (struct imap4d_command *command, char *arg)
fun
=
status_get_handler
(
item
);
if
(
!
fun
)
{
count
=
-
1
;
err_msg
=
"Invalid flag in list"
;
break
;
}
...
...
@@ -123,7 +125,7 @@ imap4d_status (struct imap4d_command *command, char *arg)
if
(
!
fun
(
smbox
))
util_send
(
" "
);
}
if
(
count
)
if
(
count
>
0
)
util_send
(
")
\r\n
"
);
mailbox_close
(
smbox
);
}
...
...
@@ -131,12 +133,15 @@ imap4d_status (struct imap4d_command *command, char *arg)
}
free
(
mailbox_name
);
if
(
count
==
0
)
return
util_finish
(
command
,
RESP_BAD
,
"Too few args (empty list)"
);
else
if
(
count
==
-
1
)
return
util_finish
(
command
,
RESP_BAD
,
"Invalid flag in list"
);
else
if
(
status
==
0
)
return
util_finish
(
command
,
RESP_OK
,
"Completed"
);
if
(
status
==
0
)
{
if
(
count
==
0
)
return
util_finish
(
command
,
RESP_BAD
,
"Too few args (empty list)"
);
else
if
(
err_msg
)
return
util_finish
(
command
,
RESP_BAD
,
err_msg
);
return
util_finish
(
command
,
RESP_OK
,
"Completed"
);
}
return
util_finish
(
command
,
RESP_NO
,
"Error opening mailbox"
);
}
...
...
Please
register
or
sign in
to post a comment