#include "serv_imap.h"
#include "imap_tools.h"
#include "imap_fetch.h"
+#include "imap_search.h"
long SYM_IMAP;
* Implements the AYTHENTICATE command
*/
void imap_authenticate(int num_parms, char *parms[]) {
- char buf[256];
+ char buf[SIZ];
if (num_parms != 3) {
cprintf("%s BAD incorrect number of parameters\r\n", parms[0]);
}
void imap_auth_login_user(char *cmd) {
- char buf[256];
+ char buf[SIZ];
decode_base64(buf, cmd);
CtdlLoginExistingUser(buf);
}
void imap_auth_login_pass(char *cmd) {
- char buf[256];
+ char buf[SIZ];
decode_base64(buf, cmd);
if (CtdlTryPassword(buf) == pass_ok) {
* implements the SELECT command
*/
void imap_select(int num_parms, char *parms[]) {
- char towhere[256];
- char augmented_roomname[256];
+ char towhere[SIZ];
+ char augmented_roomname[SIZ];
int c = 0;
int ok = 0;
int ra = 0;
* may or may not be the desired behavior in the future.
*/
void imap_lsub_listroom(struct quickroom *qrbuf, void *data) {
- char buf[256];
+ char buf[SIZ];
int ra;
/* Only list rooms to which the user has access!! */
* Back end for imap_list()
*/
void imap_list_listroom(struct quickroom *qrbuf, void *data) {
- char buf[256];
+ char buf[SIZ];
int ra;
/* Only list rooms to which the user has access!! */
* Main command loop for IMAP sessions.
*/
void imap_command_loop(void) {
- char cmdbuf[256];
- char *parms[256];
+ char cmdbuf[SIZ];
+ char *parms[SIZ];
int num_parms;
time(&CC->lastcmd);
imap_uidfetch(num_parms, parms);
}
+ else if (!strcasecmp(parms[1], "SEARCH")) {
+ imap_search(num_parms, parms);
+ }
+
+ else if ( (!strcasecmp(parms[1], "UID"))
+ && (!strcasecmp(parms[2], "SEARCH")) ) {
+ imap_uidsearch(num_parms, parms);
+ }
+
else if (!strcasecmp(parms[1], "CLOSE")) {
imap_close(num_parms, parms);
}