-
-void ctdl_sieve_init(void) {
- char *cred = NULL;
- sieve2_context_t *sieve2_context = NULL;
- int res;
-
- /*
- * We don't really care about dumping the entire credits to the log
- * every time the server is initialized. The documentation will suffice
- * for that purpose. We are making a call to sieve2_credits() in order
- * to demonstrate that we have successfully linked in to libsieve.
- */
- cred = strdup(sieve2_credits());
- if (cred == NULL) return;
-
- if (strlen(cred) > 60) {
- strcpy(&cred[55], "...");
- }
-
- lprintf(CTDL_INFO, "%s\n",cred);
- free(cred);
-
- /* Briefly initialize a Sieve parser instance just so we can list the
- * extensions that are available.
- */
- res = sieve2_alloc(&sieve2_context);
- if (res != SIEVE2_OK) {
- lprintf(CTDL_CRIT, "sieve2_alloc() returned %d: %s\n", res, sieve2_errstr(res));
- return;
- }
-
- res = sieve2_callbacks(sieve2_context, ctdl_sieve_callbacks);
- if (res != SIEVE2_OK) {
- lprintf(CTDL_CRIT, "sieve2_callbacks() returned %d: %s\n", res, sieve2_errstr(res));
- goto BAIL;
- }
-
- msiv_extensions = strdup(sieve2_listextensions(sieve2_context));
- lprintf(CTDL_INFO, "Extensions: %s\n", msiv_extensions);
-
-BAIL: res = sieve2_free(&sieve2_context);
- if (res != SIEVE2_OK) {
- lprintf(CTDL_CRIT, "sieve2_free() returned %d: %s\n", res, sieve2_errstr(res));
- }
-
-}
-
-int serv_sieve_room(struct ctdlroom *room)
-{
- if (!strcasecmp(&room->QRname[11], MAILROOM)) {
- sieve_queue_room(room);
- }
- return 0;
-}
-
-#endif /* HAVE_LIBSIEVE */
-