aboutsummaryrefslogtreecommitdiff
path: root/src/bi_sieve.m4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-12-13 18:20:45 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-12-13 18:20:45 +0000
commitcfb04309fb01de8797f85f2f945e375fd6091a99 (patch)
treec63a917781d2602db08b190b582115b56806eee4 /src/bi_sieve.m4
parent60fbc52f285b19ccbc9723cdae135cbb22acfe98 (diff)
downloadmailfromd-cfb04309fb01de8797f85f2f945e375fd6091a99.tar.gz
mailfromd-cfb04309fb01de8797f85f2f945e375fd6091a99.tar.bz2
Ported r1536 from branches/release_4_2_patches (= r1535 from tags/release_4_2):
git-svn-id: file:///svnroot/mailfromd/trunk@1538 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/bi_sieve.m4')
-rw-r--r--src/bi_sieve.m421
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bi_sieve.m4 b/src/bi_sieve.m4
index d018f9ce..f8551cb8 100644
--- a/src/bi_sieve.m4
+++ b/src/bi_sieve.m4
@@ -22,13 +22,23 @@
#define MF_SIEVE_DEBUG_MAILUTILS 0x08
#define MF_SIEVE_DEBUG_PROT 0x10
+#if MAILUTILS_VERSION_NUMBER < 1290
static int
-_mu_debug_printer (mu_debug_t unused, size_t level, const char *fmt,
- va_list ap)
+_mu_debug_printer(mu_debug_t unused, size_t level, const char *fmt,
+ va_list ap)
{
vlogmsg((level == MU_DEBUG_ERROR) ? LOG_ERR : LOG_DEBUG, fmt, ap);
return 0;
}
+typedef size_t mu_log_level_t;
+#else
+static int
+_mu_debug_printer(void *unused, mu_log_level_t level, const char *msg)
+{
+ logmsg((level == MU_DEBUG_ERROR) ? LOG_ERR : LOG_DEBUG, "%s", msg);
+ return 0;
+}
+#endif
static int
_sieve_debug_printer (void *unused, const char *fmt, va_list ap)
@@ -96,7 +106,7 @@ MF_DEFUN(sieve, NUMBER, STRING script, OPTIONAL, NUMBER dbg)
{
mu_sieve_machine_t mach;
mu_debug_t mudebug = NULL;
- int debug_flags = 0; /* FIXME: Init */
+ mu_log_level_t debug_flags = 0; /* FIXME: Init */
int sieve_debug_flags = 0;
int sieve_log = 0;
int rc = mu_sieve_machine_init(&mach, NULL);
@@ -131,7 +141,12 @@ MF_DEFUN(sieve, NUMBER, STRING script, OPTIONAL, NUMBER dbg)
mu_debug_set_print(mudebug, _mu_debug_printer, NULL);
}
+#if MAILUTILS_VERSION_NUMBER < 1290
mu_sieve_set_debug_level(mach, mudebug, sieve_debug_flags);
+#else
+ mu_sieve_set_debug_level(mach, sieve_debug_flags);
+ mu_sieve_set_debug_object(mach, mudebug);
+#endif
mu_sieve_set_parse_error(mach, _sieve_parse_error);
if (sieve_log)
mu_sieve_set_logger(mach, _sieve_action_log);

Return to:

Send suggestions and report system problems to the System administrator.