From 74dc1eb8e232bcd61b54f1eb3af3499cc06a5f06 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Fri, 1 Jan 2016 23:36:16 +0100 Subject: [PATCH 1/1] Syslog problems. --- tor-smtp/tor-smtp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)) { -- 2.47.2