Skip to content
Snippets Groups Projects
Commit ea949363 authored by rswindell's avatar rswindell
Browse files

Fix initialization of SPAM database retry_time value (was 0) and log an error

if/when the SPAM database open fails.
parent a79d0e8e
No related branches found
No related tags found
No related merge requests found
...@@ -2367,6 +2367,8 @@ static void smtp_thread(void* arg) ...@@ -2367,6 +2367,8 @@ static void smtp_thread(void* arg)
return; return;
} }
SAFEPRINTF(spam.file,"%sspam",scfg.data_dir); SAFEPRINTF(spam.file,"%sspam",scfg.data_dir);
spam.retry_time=scfg.smb_retry_time;
spam.subnum=INVALID_SUB;
srand(time(NULL) ^ (DWORD)GetCurrentThreadId()); /* seed random number generator */ srand(time(NULL) ^ (DWORD)GetCurrentThreadId()); /* seed random number generator */
rand(); /* throw-away first result */ rand(); /* throw-away first result */
...@@ -2869,7 +2871,10 @@ static void smtp_thread(void* arg) ...@@ -2869,7 +2871,10 @@ static void smtp_thread(void* arg)
,str, host_name, host_ip, rcpt_addr, reverse_path); ,str, host_name, host_ip, rcpt_addr, reverse_path);
is_spam=TRUE; is_spam=TRUE;
} }
} } else if(i!=SMB_ERR_NOT_FOUND)
lprintf(LOG_ERR,"%04d !SMTP ERROR %d (%s) opening SPAM database"
,socket, i, spam.last_error);
if(is_spam) { if(is_spam) {
size_t n,total=0; size_t n,total=0;
for(n=0;hashes[n]!=NULL;n++) for(n=0;hashes[n]!=NULL;n++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment