vstakhov / rmilter

Another sendmail milter for different mail checks.
86 stars 18 forks source link

Feature request: define multiple rspamd servers with round-robin support & failover #179

Closed stanojr closed 7 years ago

stanojr commented 7 years ago

Hello,

currently you can now set only one rspamd server in spamd { servers = }. It would be nice if you can set multiple servers and round-robin requests to them when you have rspamd cluster.

vstakhov commented 7 years ago

Rmilter supports multiple servers for Rspamd. It also supports retries and priorities for each individual server. I don't understand your issue.

stanojr commented 7 years ago

@vstakhov i cannot get it working. i am using rmilter version 1.10.0-2~xenial and 6 rspamd servers. rmilter always connect to first server and when i stop rspamd on first server it fails with "spam scan: ignored, temporary fail".

My spamd section: spamd { extended_spam_headers = yes; servers = "r:10.10.40.1:11333:3, r:10.10.40.2:11333:3, r:10.10.40.3:11333:3, r:10.10.40.4:11333:3, r:10.10.40.5:11333:3, r:10.10.40.6:11333:3"; spamd_settings_id = "mx"; reject_message = "Spam message rejected"; }

mail logs: Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; mlfi_data: queue id: <3w09YN3nkmz5vw8> Apr 7 22:05:28 mail-proxymxphy-5 postfix/cleanup[21204]: 3w09YN3nkmz5vw8: message-id=CACqn7FkNbzaFx9r9xBhDpeuFwfpmNevup559tMCCJUhsrUwsOg@mail.gmail.com Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; mlfi_eom: tempfile=/tmp/msg.XX3HmtOG, size=2658 Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: start scanning message on 10.10.40.1 Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamd: write (10.10.40.1), Connection refused Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: finish scanning message on 10.10.40.1 Apr 7 22:05:28 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamdscan: failed to scan, retry, 10.10.40.1, /tmp/msg.XX3HmtOG Apr 7 22:05:29 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: start scanning message on 10.10.40.1 Apr 7 22:05:29 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamd: write (10.10.40.1), Connection refused Apr 7 22:05:29 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: finish scanning message on 10.10.40.1 Apr 7 22:05:29 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamdscan: failed to scan, retry, 10.10.40.1, /tmp/msg.XX3HmtOG Apr 7 22:05:30 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: start scanning message on 10.10.40.1 Apr 7 22:05:30 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamd: write (10.10.40.1), Connection refused Apr 7 22:05:30 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: finish scanning message on 10.10.40.1 Apr 7 22:05:30 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamdscan: failed to scan, retry, 10.10.40.1, /tmp/msg.XX3HmtOG Apr 7 22:05:31 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: start scanning message on 10.10.40.1 Apr 7 22:05:31 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamd: write (10.10.40.1), Connection refused Apr 7 22:05:31 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: finish scanning message on 10.10.40.1 Apr 7 22:05:31 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamdscan: failed to scan, retry, 10.10.40.1, /tmp/msg.XX3HmtOG Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: start scanning message on 10.10.40.1 Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamd: write (10.10.40.1), Connection refused Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; spamdscan: finish scanning message on 10.10.40.1 Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; rspamdscan: retry limit exceeded, 10.10.40.1, /tmp/msg.XX3HmtOG Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; mlfi_eom: spamdscan() failed Apr 7 22:05:32 mail-proxymxphy-5 rmilter[21243]: <3a5b15e6d3>; msg done: queue_id: <3w09YN3nkmz5vw8>; message id: <>; ip: 209.85.161.175; from: stanojr@gmail.com; rcpt: s@bombala.org (1 total); user: unauthorized; spam scan: ignored, temporary fail; virus scan: unknown; dkim: not signed, disabled

vstakhov commented 7 years ago

Remove double quotes for servers.

stanojr commented 7 years ago

Yes, it works. Thank you.

vstakhov commented 7 years ago

Unfortunately, that's a consequence of lex + yacc parsing and legacy syntax I cannot remove because of backwards compatibility.