more debug

This commit is contained in:
whottgen 2004-10-12 12:36:52 +00:00
parent ab782fdb54
commit d56117cbb3

View File

@ -116,7 +116,7 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
syslog(LOG_DEBUG, "cyrus_work: going to check %s", input);
syslog(LOG_DEBUG, "cyrus_work: (%p) going to check %s", work_handle, input);
depot_uid = input;
if (NULL == (depot_host = strchr(depot_uid, ' '))) {
@ -130,8 +130,8 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
a_rdata = get_a_rrs(depot_host);
if (NULL == a_rdata) {
syslog(LOG_DEBUG, "cyrus_work: depot_host %s could not be found in dns",
depot_host);
syslog(LOG_DEBUG, "cyrus_work: (%p) depot_host %s could not be found in dns",
work_handle, depot_host);
snprintf(output, ANSWER_BUFSIZE, DEPOT_DNS_ERROR);
return SMM_TEMP_NOK;
}
@ -140,13 +140,14 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
free_rrs((void**)a_rdata);
syslog(LOG_DEBUG, "cyrus_work: depot_uid %s, depot_host %s", depot_uid, depot_host);
syslog(LOG_DEBUG, "cyrus_work: (%p) depot_uid %s, depot_host %s", work_handle,
depot_uid, depot_host);
lmtp = smtp_init(ip_address, cch->lmtp_port, cch->timeout);
while ((END != state) && (0 == done)) {
syslog(LOG_DEBUG, "cyrus_work, lmtp dialog state %d", state);
syslog(LOG_DEBUG, "cyrus_work: (%p) lmtp dialog state %d", work_handle, state);
switch(state) {
case CONNECT:
err = smtp_connect(lmtp);
@ -178,7 +179,7 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
switch(err) {
case SMTP_TIMEOUT:
syslog(LOG_DEBUG, "cyrus_work, timeout in lmtp dialog");
syslog(LOG_DEBUG, "cyrus_work: (%p) timeout in lmtp dialog", work_handle);
result = SMM_LOCAL_TEMP_NOK;
response_text = (char*)TIMEOUT_ERROR;
done = 1;
@ -187,13 +188,14 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
/* evaluate smtp_response, return or continue */
err = smtp_response(lmtp, &response_text);
if (-1 == err) {
syslog(LOG_DEBUG, "cyrus_work, response could not be parsed");
syslog(LOG_DEBUG, "cyrus_work: (%p) response could not be parsed", work_handle);
result = SMM_LOCAL_TEMP_NOK;
response_text = (char*)UNEXPECTED_ERROR;
done = 1;
break;
}
syslog(LOG_DEBUG, "cyrus_work, response: %d, %s", err, response_text);
syslog(LOG_DEBUG, "cyrus_work: (%p) response: %d, %s", work_handle,
err, response_text);
switch(err/100) {
case 4:
result = SMM_LOCAL_TEMP_NOK;
@ -213,7 +215,7 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
}
break;
default:
syslog(LOG_DEBUG, "cyrus_work, unexpected error in lmtp dialog");
syslog(LOG_DEBUG, "cyrus_work: (%p) unexpected error in lmtp dialog", work_handle);
result = SMM_LOCAL_TEMP_NOK;
response_text = (char*)UNEXPECTED_ERROR;
done = 1;
@ -244,6 +246,8 @@ int cyrus_work(void *handle, void *work_handle, char *input, char *output) {
smtp_destroy(lmtp);
syslog(LOG_DEBUG, "cyrus_work: (%p) result %d, %s", work_handle,
result, output);
return result;
}