* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
#include "imap_fetch.h"
#include "imap_misc.h"
#include "genstamp.h"
-
-
#include "ctdl_module.h"
+
/*
* Implements the SETACL command.
*/
*/
if ( (ra & UA_KNOWN) /* known rooms */
|| ((ra & UA_GOTOALLOWED) && (ra & UA_ZAPPED)) /* zapped rooms */
- ) {
+ ) {
strcat(rights, "l");
strcat(rights, "r");
strcat(rights, "s");
* commands are not yet implemented, omitting the flag should
* theoretically prevent compliant clients from attempting to
* perform them.
+ *
+ * strcat(rights, "a");
*/
- /* strcat(rights, "a"); * commented out */
}
}
}
*/
ret = imap_grabroom(roomname, parms[2], 1);
if (ret != 0) {
- cprintf("%s NO Invalid mailbox name or access denied\r\n",
- parms[0]);
+ cprintf("%s NO Invalid mailbox name or access denied\r\n", parms[0]);
return;
}
*/
ret = imap_grabroom(roomname, parms[2], 1);
if (ret != 0) {
- cprintf("%s NO Invalid mailbox name or access denied\r\n",
- parms[0]);
+ cprintf("%s NO Invalid mailbox name or access denied\r\n", parms[0]);
return;
}
free_recipients(valid);
}
if (ret != 0) {
- cprintf("%s NO Invalid user name or access denied\r\n",
- parms[0]);
+ cprintf("%s NO Invalid user name or access denied\r\n", parms[0]);
return;
}
}
CtdlUserGoto(roomname, 0, 0, &msgs, &new);
-
/*
* Now output the list of rights
*/
imap_strout(""); /* FIXME ... do something here */
cprintf("\r\n");
-
/*
* If another folder is selected, go back to that room so we can resume
* our happy day without violent explosions.
ret = imap_grabroom(roomname, parms[2], 1);
if (ret != 0) {
- cprintf("%s NO Invalid mailbox name or access denied\r\n",
- parms[0]);
+ cprintf("%s NO Invalid mailbox name or access denied\r\n", parms[0]);
return;
}
cprintf("%s OK MYRIGHTS completed\r\n", parms[0]);
return;
}
-
-
cprintf(")");
}
+
void imap_fetch_internaldate(struct CtdlMessage *msg) {
char buf[SIZ];
time_t msgdate;
}
CtdlLogPrintf(CTDL_DEBUG, "Section is: %s%s\n",
section,
- IsEmptyStr(section) ? "(empty)" : "");
+ IsEmptyStr(section) ? "(empty)" : ""
+ );
/* Burn the cache if we don't have the same section of the
* same message again.
}
}
}
-
}
*
* Implements the STORE command in IMAP.
*
- *
* Copyright (c) 2001-2009 by the citadel.org team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ctdl_module.h"
-
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "genstamp.h"
-
-
-
-
/*
* imap_do_store() calls imap_do_store_msg() to tweak the settings of
* an individual message.
}
-
/*
* imap_store() calls imap_do_store() to perform the actual bit twiddling
* on the flags.
* Copyright (c) 2001-2009 by the citadel.org team and others, except for
* most of the UTF7 and UTF8 handling code which was lifted from Evolution.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
* is perfect. Indeed, with so much gratuitous complexity, *all* IMAP
* implementations have bugs.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
#include "imap_metadata.h"
#include "imap_misc.h"
-
#include "ctdl_module.h"
}
-
-
-
-
-
/*
* This cleanup function blows away the temporary memory and files used by
* the IMAP server.
*/
}
+
/*
* implements the CAPABILITY command
*/
}
-
/*
* Implements the ID command (specified by RFC2971)
*
}
-
/*
* Here's where our IMAP session begins its happy day.
*/
cprintf("] %s IMAP4rev1 %s ready\r\n", config.c_fqdn, CITADEL);
}
+
/*
* IMAPS is just like IMAP, except it goes crypto right away.
*/
}
}
+
void imap_auth_plain(char *cmd)
{
char decoded_authstring[1024];
cprintf("%s NO authentication failed\r\n", IMAP->authseq);
}
+
void imap_auth_login_user(char *cmd)
{
char buf[SIZ];
return;
}
+
void imap_auth_login_pass(char *cmd)
{
char buf[SIZ];
char nosup_response[SIZ];
char error_response[SIZ];
- sprintf(ok_response,
- "%s OK begin TLS negotiation now\r\n",
- parms[0]);
- sprintf(nosup_response,
- "%s NO TLS not supported here\r\n",
- parms[0]);
- sprintf(error_response,
- "%s BAD Internal error\r\n",
- parms[0]);
+ sprintf(ok_response, "%s OK begin TLS negotiation now\r\n", parms[0]);
+ sprintf(nosup_response, "%s NO TLS not supported here\r\n", parms[0]);
+ sprintf(error_response, "%s BAD Internal error\r\n", parms[0]);
CtdlModuleStartCryptoMsgs(ok_response, nosup_response, error_response);
}
/* Then try a mailbox name match */
if (c != 0) {
- CtdlMailboxName(augmented_roomname, sizeof augmented_roomname,
- &CC->user, towhere);
+ CtdlMailboxName(augmented_roomname, sizeof augmented_roomname, &CC->user, towhere);
c = CtdlGetRoom(&QRscratch, augmented_roomname);
- if (c == 0)
+ if (c == 0) {
strcpy(towhere, augmented_roomname);
+ }
}
/* If the room exists, check security/access */
/* Fail here if no such room */
if (!ok) {
- cprintf("%s NO ... no such room, or access denied\r\n",
- parms[0]);
+ cprintf("%s NO ... no such room, or access denied\r\n", parms[0]);
return;
}
cprintf("%s OK [%s] %s completed\r\n",
parms[0],
- (IMAP->readonly ? "READ-ONLY" : "READ-WRITE"), parms[1]);
+ (IMAP->readonly ? "READ-ONLY" : "READ-WRITE"), parms[1]
+ );
}
-
/*
* Does the real work for expunge.
*/
imap_rescan_msgids();
}
- CtdlLogPrintf(CTDL_DEBUG, "Expunged %d messages from <%s>\n",
- num_expunged, CC->room.QRname);
+ CtdlLogPrintf(CTDL_DEBUG, "Expunged %d messages from <%s>\n", num_expunged, CC->room.QRname);
return (num_expunged);
}
}
-
/*
* Implements the CREATE command
*
}
-
/*
* Implements the SUBSCRIBE command
*
}
-
/*
* Implements the DELETE command
*
}
-
-
/*
* Main command loop for IMAP sessions.
*/
return;
}
-
/* Ok, at this point we're in normal command mode.
* If the command just submitted does not contain a literal, we
* might think about delivering some untagged stuff...