* applied Patrick Colemans patch
[citadel.git] / citadel / modules / imap / imap_misc.c
index 671c6ce5fdc2f1c1847b3b2b78bbec4054cea25b..f0f93627ef3af50ed7d7ddebf4f31d1a57c771ab 100644 (file)
@@ -30,6 +30,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "sysdep_decls.h"
@@ -41,7 +42,6 @@
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
-#include "tools.h"
 #include "internet_addressing.h"
 #include "serv_imap.h"
 #include "imap_tools.h"
@@ -454,7 +454,7 @@ void imap_append(int num_parms, char *parms[]) {
         * 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']);
@@ -467,7 +467,7 @@ void imap_append(int num_parms, char *parms[]) {
        /* 
         * Can we post here?
         */
-       ret = CtdlDoIHavePermissionToPostInThisRoom(buf, sizeof buf);
+       ret = CtdlDoIHavePermissionToPostInThisRoom(buf, sizeof buf, POST_LOGGED_IN);
 
        if (ret) {
                /* Nope ... print an error message */