Mercurial > dnsbl
comparison src/context.cpp @ 310:802e2b779ed1
enable smtp verify logging
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 18 Sep 2016 18:32:37 -0700 |
parents | 368572c57013 |
children | f5547e7b3a09 |
comparison
equal
deleted
inserted
replaced
309:358b764a862e | 310:802e2b779ed1 |
---|---|
248 | 248 |
249 #ifdef VERIFY_DEBUG | 249 #ifdef VERIFY_DEBUG |
250 void SMTP::log(const char *m, int v) { | 250 void SMTP::log(const char *m, int v) { |
251 char buf[maxlen]; | 251 char buf[maxlen]; |
252 snprintf(buf, maxlen, m, v); | 252 snprintf(buf, maxlen, m, v); |
253 my_syslog(buf); | 253 my_syslog(queueid, buf); |
254 } | 254 } |
255 | 255 |
256 | 256 |
257 void SMTP::log(const char *m, const char *v) { | 257 void SMTP::log(const char *m, const char *v) { |
258 char buf[maxlen]; | 258 char buf[maxlen]; |
259 snprintf(buf, maxlen, m, v); | 259 snprintf(buf, maxlen, m, v); |
260 my_syslog(buf); | 260 my_syslog(queueid, buf); |
261 } | 261 } |
262 #endif | 262 #endif |
263 | 263 |
264 | 264 |
265 //////////////////////////////////////////////// | 265 //////////////////////////////////////////////// |
369 pthread_mutex_unlock(&mutex); | 369 pthread_mutex_unlock(&mutex); |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 | 373 |
374 bool VERIFY::ok(const char *from, const char *to) { | 374 bool VERIFY::ok(const char *queueid, const char *from, const char *to) { |
375 if (host == token_myhostname) return true; | 375 if (host == token_myhostname) return true; |
376 SMTP *conn = get_connection(); | 376 SMTP *conn = get_connection(); |
377 if (!conn) return true; // cannot verify right now, we have socket errors | 377 if (!conn) return true; // cannot verify right now, we have socket errors |
378 int rc; | 378 int rc; |
379 conn->set_id(queueid); | |
379 rc = conn->from(from); | 380 rc = conn->from(from); |
380 #ifdef VERIFY_DEBUG | 381 #ifdef VERIFY_DEBUG |
381 conn->log("verify::ok() from sees %d", rc); | 382 conn->log("verify::ok() from sees %d", rc); |
382 #endif | 383 #endif |
383 if (rc != 250) { | 384 if (rc != 250) { |