From b690a4bb5cd4edab251fd16c90c67a596d5bb3bf Mon Sep 17 00:00:00 2001 From: SJ Date: Sun, 27 Jan 2013 21:57:15 +0100 Subject: [PATCH] let piler child process give 421 error if it cannot connect to database --- src/session.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/session.c b/src/session.c index 6207d199..8af4324d 100644 --- a/src/session.c +++ b/src/session.c @@ -79,6 +79,11 @@ int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg){ syslog(LOG_PRIORITY, "%s", ERR_MYSQL_CONNECT); #endif + if(db_conn == 0){ + send(new_sd, SMTP_RESP_421_ERR_TMP, strlen(SMTP_RESP_421_ERR_TMP), 0); + return 0; + } + gettimeofday(&tv1, &tz);