Closed 1n5aN1aC closed 6 years ago
Probably related to this : https://github.com/rspamd/rspamd/issues/2360
A bug introduced in Rspamd 1.7.8 in ratelimit.lua
has been fixed in Rspamd 1.7.9.
What version do you use ? This bug should not happen with the current builds on docker hub. 1.1-stable
use rspamd 1.7.7 and 1.1-latest
use rspamd 1.7.9.
Enable rspamd debug mode (only available in 1.1-latest
for now) and search this lines :
(rspamd_proxy) <c7afe8>; lua; ratelimit.lua:394: ratelimit "to(1666:contact@domain.tld)" exceeded, (4 / 60): 0 (0:10.1221 dyn)
(rspamd_proxy) <c7afe8>; proxy; lua_task_set_pre_result: <20180721113120.374.33368@fcb246e58660>: set pre-result to soft reject: 'Ratelimit "to" exceeded'
mailserver:
environment:
DEBUG_MODE=rspamd
Looks like it.
2018-08-16T21:35:13.113368+00:00 mail rspamd[751]: <d18980>; lua; ratelimit.lua:479: ratelimit "to(25000:myusername@mydomain.net)" exceeded, (4 / 0.016667): 0 (0:4.1535 dyn)
2018-08-16T21:35:13.113593+00:00 mail rspamd[751]: <d18980>; proxy; lua_task_set_pre_result: <1534453528-13556-1-git-send-email-bo.liu@linux.alibaba.com>: set pre-result to soft reject: 'Ratelimit "to" exceeded'
I ran rspamd --version
inside the docker, and it says Rspamd daemon version 1.7.9
my docker image is currently on 516b57796ea2 hardware/mailserver:1.1-latest
Hmm, not sure where to go from here. I only have these directories mapped to the host / a volume:
volumes:
- ${VOLUMES_ROOT_PATH}/mail:/var/mail
- ${VOLUMES_ROOT_PATH}/traefik/acme:/etc/letsencrypt/acme
For an easy fix you can just disable the ratelimit until you figure what is happening:
environment:
- DISABLE_RATELIMITING=true # Disable ratelimiting policy
@navossoc Thanks, I'm getting emails now! So. Many.
@hardware Thanks, that was indeed the issue. Not sure how it could have happened though, as my comment above shows, I'm on rspamd 1.7.9, and I haven't done much customization on the container.
Here's my docker-compose.yml snippet.
mailserver:
image: hardware/mailserver:${MAILSERVER_DOCKER_TAG}
container_name: mailserver
restart: ${RESTART_MODE}
domainname: ${DOMAIN} # Mail server A/MX/FQDN & reverse PTR = mail.domain.tld.
hostname: ${HOSTNAME}
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:spam.${DOMAIN}
- traefik.port=11334
- traefik.docker.network=http_network
ports:
- "25:25" # SMTP - Required
- "143:143" # IMAP STARTTLS - Optional - For webmails/desktop clients
# - "465:465" # SMTPS SSL/TLS - Optional - Enabled for compatibility reason, otherwise disabled
- "587:587" # Submission STARTTLS - Optional - For webmails/desktop clients
- "993:993" # IMAPS SSL/TLS - Optional - For webmails/desktop clients
- "4190:4190" # SIEVE STARTTLS - Optional - Recommended for mail filtering
environment:
- DBPASS=${DATABASE_USER_PASSWORD} # MariaDB database password (required)
- RSPAMD_PASSWORD=${RSPAMD_PASSWORD} # Rspamd WebUI password (required)
- OPENDKIM_KEY_LENGTH=1024 # Apparently Namecheap only supports 255 character txt records
# - ENABLE_POP3=true # Enable POP3 protocol
# - ENABLE_FETCHMAIL=true # Enable fetchmail forwarding
# - DISABLE_CLAMAV=true # Disable virus scanning
# - DISABLE_SIGNING=true # Disable DKIM/ARC signing
# - DISABLE_GREYLISTING=true # Disable greylisting policy
- DISABLE_RATELIMITING=true # Disable ratelimiting policy
#
# Full list : https://github.com/hardware/mailserver#environment-variables
volumes:
- ${VOLUMES_ROOT_PATH}/mail:/var/mail
- ${VOLUMES_ROOT_PATH}/traefik/acme:/etc/letsencrypt/acme
depends_on:
- mariadb
- redis
networks:
- mail_network
- http_network
@1n5aN1aC Can you try ratelimit.lua
from the rspamd master branch ?
https://github.com/rspamd/rspamd/blob/master/src/plugins/lua/ratelimit.lua
mailserver:
volumes:
- ratelimit.lua:/usr/share/rspamd/lua/ratelimit.lua
Retry without DISABLE_RATELIMITING
.
That does appear to have resolved the issue. I then removed the ratelimit mapping etc, deleted the container, and put everything back up.
It appears as if the issue is resolved. Very strange as I haven't messed with any of the files inside the container, so I'm not sure how that could have happened.
Regardless, I'll be finding out whether or not it is resolved soon!
Very strange as I haven't messed with any of the files inside the container, so I'm not sure how that could have happened
This is probably not an issue on your side. Even if I have no more problems with version 1.7.9, that does not mean that the issue is definitely fixed for everybody. I think we have to wait for rspamd to stabilize his ratelimit algorithm.
I think I will stop updating it all the time, this is definitely not safe. But debian does not provide a recent and stable package, so I do not know how to do that.
I will disable the ratelimiting policy by default so that I can update the stable version and to avoid any future problem. Everyone will be free to activate it as needed with DISABLE_RATELIMITING=false
and setting the thresholds manually.
LGTM until rspamd makes it stable.
Classification
Reproducibility
Description
Ever since I updated my containers ~36 hours ago, (hardware/mailserver 81382b09484e) I have not been able to send any emails out. I updated again just now (hardware/mailserver d8e27be1671f) and same results.
As part of investigating that issue, I discovered that spamd is "temporarily rejecting" nearly all incoming emails. I believe the only emails I have gotten successfully since then are from YouTube & Steam.
Debugging information
rspamd webgui records all emails attempted to be sent and received, but provides no information about any of them except that they were "soft reject" My install was working fine and had not been updated, then broke when I updated all my dockers ~36 hours ago, so more recent commits could not cause this, while #275 #277 are both possible culprits.