#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"
CC->redirect_buffer = malloc(SIZ);
CC->redirect_len = 0;
CC->redirect_alloc = SIZ;
- CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ONLY, 0, 1);
+ CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_FAST, 0, 1, 0);
fieldptr = rfc822_fetch_field(CC->redirect_buffer, itemlist[pos+1]);
if (fieldptr != NULL) {
int is_in_list = 0;
int num_results = 0;
+ /* Strip parentheses. We realize that this method will not work
+ * in all cases, but it seems to work with all currently available
+ * client software. Revisit later...
+ */
+ for (i=0; i<num_items; ++i) {
+ if (itemlist[i][0] == '(') {
+ strcpy(&itemlist[i][0], &itemlist[i][1]);
+ }
+ if (itemlist[i][strlen(itemlist[i])-1] == ')') {
+ itemlist[i][strlen(itemlist[i])-1] = 0;
+ }
+ }
+
/* If there is a BODY search criterion in the query, use our full
* text index to disqualify messages that don't have any chance of
* matching. (Only do this if the index is enabled!!)