# HG changeset patch # User Carl Byington # Date 1481996800 28800 # Node ID e27c24c1974a21fc219b23f8ef77c6e447e1c909 # Parent 0ed4de7ce05bd67008e8593b939ed10d0a642d7b more smtp verify logging diff -r 0ed4de7ce05b -r e27c24c1974a src/context.cpp --- a/src/context.cpp Thu Sep 22 08:49:44 2016 -0700 +++ b/src/context.cpp Sat Dec 17 09:46:40 2016 -0800 @@ -268,6 +268,13 @@ } +void VERIFY::log(const char *m, const char *q, const char *v) { + char buf[maxlen]; + snprintf(buf, maxlen, m, v, host); + my_syslog(q, buf); +} + + void VERIFY::closer() { bool ok = true; while (ok) { @@ -391,7 +398,10 @@ bool VERIFY::ok(const char *queueid, const char *from, const char *to) { if (host == token_myhostname) return true; SMTP *conn = get_connection(queueid); - if (!conn) return true; // cannot verify right now, we have socket errors + if (!conn) { + log("unable to verify %s with %s due to socket errors", queueid, to); + return true; // cannot verify right now, we have socket errors + } int rc; rc = conn->from(from); conn->log("verify::ok(%d) from sees %d", rc); diff -r 0ed4de7ce05b -r e27c24c1974a src/context.h --- a/src/context.h Thu Sep 22 08:49:44 2016 -0700 +++ b/src/context.h Sat Dec 17 09:46:40 2016 -0800 @@ -91,6 +91,7 @@ smtp_list connections;// open sockets, ready to be used public: VERIFY(const char *h); + void log(const char *m, const char *q, const char *v); void closer(); // if the oldest socket is ancient, close it SMTP *get_connection(const char *queueid); void put_connection(SMTP *conn);