comparison src/context.cpp @ 320:e27c24c1974a

more smtp verify logging
author Carl Byington <carl@five-ten-sg.com>
date Sat, 17 Dec 2016 09:46:40 -0800
parents e2dc882839f6
children e172dc10fe24
comparison
equal deleted inserted replaced
319:0ed4de7ce05b 320:e27c24c1974a
266 last_err = 0; 266 last_err = 0;
267 pthread_mutex_init(&mutex, 0); 267 pthread_mutex_init(&mutex, 0);
268 } 268 }
269 269
270 270
271 void VERIFY::log(const char *m, const char *q, const char *v) {
272 char buf[maxlen];
273 snprintf(buf, maxlen, m, v, host);
274 my_syslog(q, buf);
275 }
276
277
271 void VERIFY::closer() { 278 void VERIFY::closer() {
272 bool ok = true; 279 bool ok = true;
273 while (ok) { 280 while (ok) {
274 SMTP *conn = NULL; 281 SMTP *conn = NULL;
275 pthread_mutex_lock(&mutex); 282 pthread_mutex_lock(&mutex);
389 396
390 397
391 bool VERIFY::ok(const char *queueid, const char *from, const char *to) { 398 bool VERIFY::ok(const char *queueid, const char *from, const char *to) {
392 if (host == token_myhostname) return true; 399 if (host == token_myhostname) return true;
393 SMTP *conn = get_connection(queueid); 400 SMTP *conn = get_connection(queueid);
394 if (!conn) return true; // cannot verify right now, we have socket errors 401 if (!conn) {
402 log("unable to verify %s with %s due to socket errors", queueid, to);
403 return true; // cannot verify right now, we have socket errors
404 }
395 int rc; 405 int rc;
396 rc = conn->from(from); 406 rc = conn->from(from);
397 conn->log("verify::ok(%d) from sees %d", rc); 407 conn->log("verify::ok(%d) from sees %d", rc);
398 if (rc != 250) { 408 if (rc != 250) {
399 put_connection(conn); 409 put_connection(conn);