/* folder/index testing */ #include "camel-test.h" #include "messages.h" #include "folders.h" #include "camel/camel-exception.h" #include "camel/camel-service.h" #include "camel/camel-session.h" #include "camel/camel-store.h" #include "camel/camel-folder.h" #include "camel/camel-folder-summary.h" #include "camel/camel-mime-message.h" #include "camel/camel-filter-driver.h" #include "camel/camel-stream-fs.h" #define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0])) /* god, who designed this horrid interface */ static char *auth_callback(CamelAuthCallbackMode mode, char *data, gboolean secret, CamelService *service, char *item, CamelException *ex) { return NULL; } struct { char *name; CamelFolder *folder; } mailboxes[] = { { "INBOX", NULL }, { "folder1", NULL }, { "folder2", NULL }, { "folder3", NULL }, { "folder4", NULL }, }; struct { char *name, *match, *action; } rules[] = { { "empty1", "(match-all (header-contains \"Frobnitz\"))", "(copy-to \"folder1\")" }, { "empty2", "(header-contains \"Frobnitz\")", "(copy-to \"folder2\")" }, { "count11", "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))", "(move-to \"folder3\")" }, { "empty3", "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))", "(move-to \"folder4\")" }, { "count1", "(body-contains \"data50\")", "(copy-to \"folder1\")" }, { "stop", "(body-contains \"data2\")", "(stop)" }, { "notreached1", "(body-contains \"data2\")", "(move-to \"folder2\")" }, { "count1", "(body-contains \"data3\")", "(move-to \"folder2\")" }, }; static CamelFolder *get_folder(CamelFilterDriver *d, const char *uri, void *data) { int i; for (i=0;i