#include <ctype.h>
#include <string.h>
#include <limits.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "sysdep_decls.h"
#include "policy.h"
#include "database.h"
#include "msgbase.h"
-#include "tools.h"
#include "internet_addressing.h"
#include "serv_imap.h"
#include "imap_tools.h"
#include "imap_fetch.h"
#include "imap_misc.h"
#include "genstamp.h"
-
+#include "ctdl_module.h"
client_getln(buf, sizeof buf);
/* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */
- lprintf(CTDL_DEBUG, "Converting CRLF to LF\n");
+ CtdlLogPrintf(CTDL_DEBUG, "Converting CRLF to LF\n");
stripped_length = 0;
for (i=0; i<literal_length; ++i) {
if (strncmp(&Imap->transmitted_message[i], "\r\n", 2)) {
literal_length = stripped_length;
Imap->transmitted_message[literal_length] = 0; /* reterminate it */
- lprintf(CTDL_DEBUG, "Converting message format\n");
+ CtdlLogPrintf(CTDL_DEBUG, "Converting message format\n");
msg = convert_internet_message(Imap->transmitted_message);
Imap->transmitted_message = NULL;
Imap->transmitted_length = 0;
* private mailboxes.
*/
if (CC->logged_in) {
- if ( (CC->room.QRflags & QR_MAILBOX) == 0) {
+ if ( ((CC->room.QRflags & QR_MAILBOX) == 0) && (config.c_imap_keep_from == 0)) {
if (msg->cm_fields['A'] != NULL) free(msg->cm_fields['A']);
if (msg->cm_fields['N'] != NULL) free(msg->cm_fields['N']);
if (msg->cm_fields['H'] != NULL) free(msg->cm_fields['H']);
/*
* Can we post here?
*/
- ret = CtdlDoIHavePermissionToPostInThisRoom(buf, sizeof buf);
+ ret = CtdlDoIHavePermissionToPostInThisRoom(buf, sizeof buf, NULL, POST_LOGGED_IN);
if (ret) {
/* Nope ... print an error message */
else {
/* Yes ... go ahead and post! */
if (msg != NULL) {
- new_msgnum = CtdlSubmitMsg(msg, NULL, "");
+ new_msgnum = CtdlSubmitMsg(msg, NULL, "", 0);
}
if (new_msgnum >= 0L) {
cprintf("%s OK [APPENDUID %ld %ld] APPEND completed\r\n",