5
/* Cyrus SASL logging call-back routine
7
/* #include <xsasl_cyrus_common.h>
9
/* int xsasl_cyrus_log(context, priority, text)
14
/* xsasl_cyrus_log() logs a Cyrus message.
16
/* Fatal: out of memory.
20
/* The Secure Mailer license must be distributed with this software.
23
/* IBM T.J. Watson Research
25
/* Yorktown Heights, NY 10598, USA
32
/* Utility library. */
36
/* Application-specific */
38
#include <xsasl_cyrus_common.h>
40
#if defined(USE_SASL_AUTH) && defined(USE_CYRUS_SASL)
45
/* xsasl_cyrus_log - logging callback */
47
int xsasl_cyrus_log(void *unused_context, int priority,
51
case SASL_LOG_ERR: /* unusual errors */
52
#ifdef SASL_LOG_WARN /* non-fatal warnings (Cyrus-SASL v2) */
55
#ifdef SASL_LOG_WARNING /* non-fatal warnings (Cyrus-SASL v1) */
56
case SASL_LOG_WARNING:
58
msg_warn("SASL authentication problem: %s", message);
61
case SASL_LOG_INFO: /* other info (Cyrus-SASL v1) */
63
msg_info("SASL authentication info: %s", message);
67
case SASL_LOG_NOTE: /* other info (Cyrus-SASL v2) */
69
msg_info("SASL authentication info: %s", message);
73
case SASL_LOG_FAIL: /* authentication failures
75
msg_warn("SASL authentication failure: %s", message);
79
case SASL_LOG_DEBUG: /* more verbose than LOG_NOTE
82
msg_info("SASL authentication debug: %s", message);
86
case SASL_LOG_TRACE: /* traces of internal
87
* protocols (Cyrus-SASL v2) */
89
msg_info("SASL authentication trace: %s", message);
93
case SASL_LOG_PASS: /* traces of internal
94
* protocols, including
95
* passwords (Cyrus-SASL v2) */
97
msg_info("SASL authentication pass: %s", message);