It would be good to have some kind of info in troubleshooting log for SPAM checks how much time each check took to finish. I've checked my gateways after business hours and reenabled RBLs and URIBLs and started to observe that more messages are being stuck in Spool with Spam check status. Another interesting fact is that MailService process was using about 95% of CPU where this process is only a incoming gateway service. No users etc and in Spool there was only about 480 messages.
Example from Spam Checks log:
2023.07.14 18:48:20.253 [77372409] SpamCheck Processing Thread Started
2023.07.14 18:48:20.316 [77372409] Filetype Checks started.
2023.07.14 18:48:20.316 [77372409] Filetype Checks completed.
2023.07.14 18:48:20.316 [77372409] Spam checks to run: Reverse Dns Lookup, Null Sender, _SPF, _DK, _DKIM, Custom Rules, Barracuda, GBUdb, HostKarma - Blacklist, MAILSPIKE Z, SORBS - Abuse, SORBS - SMTP, Spamhaus - CBL, UCEProtect Level 1, UCEProtect Level 2, UCEProtect Level 3, VIRUS RBL - MSRBL, Backscatter, Anonmails, SpamRATS - Spam, SpamRATS - Dyna, SURRIEL, SORBS - SPAM, Received, SPAM - Return-Path
2023.07.14 18:48:20.316 [77372409] Found 25 spam checks to run: Reverse Dns Lookup, Null Sender, _SPF, _DK, _DKIM, Custom Rules, Barracuda, GBUdb, HostKarma - Blacklist, MAILSPIKE Z, SORBS - Abuse, SORBS - SMTP, Spamhaus - CBL, UCEProtect Level 1, UCEProtect Level 2, UCEProtect Level 3, VIRUS RBL - MSRBL, Backscatter, Anonmails, SpamRATS - Spam, SpamRATS - Dyna, SURRIEL, SORBS - SPAM, Received, SPAM - Return-Path
2023.07.14 18:48:20.316 [77372409] Spam check args: from: ......@gmail.com; messageID: 77372409; messagePath: D:\Poczta\Spool\SubSpool0\-1530777372409.eml; sender: ......@gmail.com; sendersDomain: gmail.com; sendersIp: 209.85.221.194; returnPath: .......@gmail.com; sendersEhlo: .........google.com
2023.07.14 18:48:20.316 [77372409] [209.85.221.194] Valid reverse DNS entry found: mail-vk1-f194.google.com
2023.07.14 18:48:20.316 [77372409] Running SPF check
2023.07.14 18:48:20.316 [77372409] Finished SPF check; result = Pass
2023.07.14 18:48:20.316 [77372409] [DKIM] Performing DKIM check...
2023.07.14 18:48:20.316 [77372409] [DKIM] Result: Good.
2023.07.14 18:50:08.252 [77372409] Spam Checks took 107942 ms
2023.07.14 18:50:08.252 [77372409] Spam Checks completed.
2023.07.14 18:50:08.252 [77372409] SpamCheck Processing Thread Completed
2023.07.14 18:49:13.387 [77372392] Spam Checks took 128398 ms
2023.07.14 18:49:17.162 [77372411] Spam Checks took 104985 ms
2023.07.14 18:49:20.657 [77372401] Spam Checks took 126090 ms
2023.07.14 18:49:20.719 [77372390] Spam Checks took 118808 ms
2023.07.14 18:49:23.948 [77372335] Spam Checks took 127264 ms
2023.07.14 18:49:25.539 [77372429] Spam Checks took 90861 ms
2023.07.14 18:49:26.163 [77372414] Spam Checks took 93317 ms
2023.07.14 18:49:29.159 [77372412] Spam Checks took 117648 ms
2023.07.14 18:49:29.283 [77372413] Spam Checks took 107531 ms
2023.07.14 18:49:32.481 [77372415] Spam Checks took 122098 ms
2023.07.14 18:49:40.032 [77372435] Spam Checks took 87104 ms
2023.07.14 18:49:54.337 [77372394] Spam Checks took 147562 ms
2023.07.14 18:49:59.376 [77372423] Spam Checks took 113966 ms
2023.07.14 18:50:08.252 [77372409] Spam Checks took 107942 ms
Disabling some of RBLs and URIBL and restarting SmarterMail service allowed to rescan for Spam messages in Spool and Waiting for Deliver which quite fast emptied Spool section (where Spool section had stuck messages even after RBLs and URIBLs disabling) and ended up with aboue 30-40% CPU usage of MailService process which IMHO is still way to high.
Maybe it would be good to have some kind of failsafe mechanism which when enabled will disable for some X minutes RBLs which are taking too long for check?