From: Petter Reinholdtsen Date: Fri, 1 Jan 2016 22:36:16 +0000 (+0100) Subject: Syslog problems. X-Git-Url: https://pere.pagekite.me/gitweb/exim4-smtorp.git/commitdiff_plain/74dc1eb8e232bcd61b54f1eb3af3499cc06a5f06 Syslog problems. --- diff --git a/tor-smtp/tor-smtp.c b/tor-smtp/tor-smtp.c index 130876a..74acdcb 100644 --- a/tor-smtp/tor-smtp.c +++ b/tor-smtp/tor-smtp.c @@ -42,6 +42,7 @@ #include #include #include +#include /* for BSD: htons is in there: */ #include #include "atomicio.h" @@ -266,7 +267,9 @@ int main(int argc, char **argv) fprintf(stderr, " (default localhost 9050)\n"); return 2; } - + + openlog("tor-smtp", LOG_PID, LOG_MAIL); + printf("220 Welcome\r\n"); fflush(stdout); @@ -308,6 +311,8 @@ int main(int argc, char **argv) if (fd < 0) { printf("421 could not connect\r\n"); fflush(stdout); + syslog(LOG_WARNING, "tor connection to %s failed", + remote_server); return 0; } @@ -315,6 +320,7 @@ int main(int argc, char **argv) if (linelen < 0) { printf("421 could not connect\r\n"); fflush(stdout); + syslog(LOG_WARNING, "no welcome message from %s", remote_server); return 0; } if (strncmp("220 ", buf2, 4)) {