From c96693f98ffe4835bd2e984eb8f36e861d72e922 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 1 Nov 2017 07:54:16 +0100 Subject: [PATCH] piler-smtp wont scare users with epoll error if the remote end just disconnected Signed-off-by: Janos SUTO --- src/config.h | 3 ++- src/piler-smtp.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/config.h b/src/config.h index bc07fba3..4964c467 100644 --- a/src/config.h +++ b/src/config.h @@ -11,7 +11,7 @@ #define VERSION "1.3.2" -#define BUILD 981 +#define BUILD 982 #define HOSTID "mailarchiver" @@ -62,6 +62,7 @@ #define _LOG_INFO 3 #define _LOG_DEBUG 5 +#define _LOG_EXTREME 100 #define MAX_RCPT_TO 128 diff --git a/src/piler-smtp.c b/src/piler-smtp.c index a3b56393..6ac8c9ef 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -206,8 +206,11 @@ int main(int argc, char **argv){ n = epoll_wait(efd, events, cfg.max_connections, -1); for(i=0; i= _LOG_EXTREME) syslog(LOG_PRIORITY, "ERROR: the remote end hung up without sending QUIT"); close(events[i].data.fd); continue; } @@ -275,7 +278,7 @@ int main(int argc, char **argv){ else readlen = read(events[i].data.fd, (char*)&readbuf[0], sizeof(readbuf)-1); - if(cfg.verbosity >= _LOG_DEBUG && readlen > 0) syslog(LOG_PRIORITY, "got %ld bytes to read", readlen); + if(cfg.verbosity >= _LOG_EXTREME && readlen > 0) syslog(LOG_PRIORITY, "got %ld bytes to read", readlen); if(readlen == -1){ /* If errno == EAGAIN, that means we have read all data. So go back to the main loop. */