7 /* Cyrus SASL logging call-back routine
9 /* #include <xsasl_cyrus_common.h>
11 /* int xsasl_cyrus_log(context, priority, text)
16 /* xsasl_cyrus_log() logs a Cyrus message.
18 /* Fatal: out of memory.
22 /* The Secure Mailer license must be distributed with this software.
25 /* IBM T.J. Watson Research
27 /* Yorktown Heights, NY 10598, USA
34 /* Utility library. */
38 /* Application-specific */
40 #include <xsasl_cyrus_common.h>
42 #if defined(USE_SASL_AUTH) && defined(USE_CYRUS_SASL)
47 /* xsasl_cyrus_log - logging callback */
49 int xsasl_cyrus_log(void *unused_context
, int priority
,
53 case SASL_LOG_ERR
: /* unusual errors */
54 #ifdef SASL_LOG_WARN /* non-fatal warnings (Cyrus-SASL v2) */
57 #ifdef SASL_LOG_WARNING /* non-fatal warnings (Cyrus-SASL v1) */
58 case SASL_LOG_WARNING
:
60 msg_warn("SASL authentication problem: %s", message
);
63 case SASL_LOG_INFO
: /* other info (Cyrus-SASL v1) */
65 msg_info("SASL authentication info: %s", message
);
69 case SASL_LOG_NOTE
: /* other info (Cyrus-SASL v2) */
71 msg_info("SASL authentication info: %s", message
);
75 case SASL_LOG_FAIL
: /* authentication failures
77 msg_warn("SASL authentication failure: %s", message
);
81 case SASL_LOG_DEBUG
: /* more verbose than LOG_NOTE
84 msg_info("SASL authentication debug: %s", message
);
88 case SASL_LOG_TRACE
: /* traces of internal
89 * protocols (Cyrus-SASL v2) */
91 msg_info("SASL authentication trace: %s", message
);
95 case SASL_LOG_PASS
: /* traces of internal
96 * protocols, including
97 * passwords (Cyrus-SASL v2) */
99 msg_info("SASL authentication pass: %s", message
);