docker-mailserver: Rspamd rejects `asciinema` e-mails
š Preliminary Checks
- I tried searching for an existing issue and followed the debugging docs advice, but still need assistance.
š What Happened?
I wanted to log into asciinema but didnāt get the login email. When I used another one it worked fine.
When looking into logs I see that the message was outrights rejected instead of being moved to the spam folder:
Logs
May 7 23:04:43 mx postfix/smtpd[717267]: 0437429007C5: client=unknown[64.147.123.154]
May 7 23:04:43 mx postfix/cleanup[717285]: 0437429007C5: message-id=<>
May 7 23:04:43 mx postfix/cleanup[717285]: 0437429007C5: milter-reject: END-OF-MESSAGE from unknown[64.147.123.154]: 5.7.1 Spam message rejected; from=<hello@hello.asciinema.org> to=<my@email> proto=ESMTP helo=<wfhigh3-smtp.messagingengine.com>
May 7 23:04:43 mx postfix/smtpd[717267]: disconnect from unknown[64.147.123.154] ehlo=2 starttls=1 mail=1 rcpt=1 data=0/1 quit=1 commands=6/7
š Reproduction Steps
- Use rspamd
- Try to log into asciinema
- See no email in inbox or junk
- See that the server rejected it outright in the logs
š DMS Version
v13.3.1
š» Operating System and Architecture
Debian GNU/Linux 11 (bullseye) aarch64
āļø Container configuration files
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: mailserver
hostname: mx.example.com
env_file: stack.env
environment:
SSL_TYPE: letsencrypt
SSL_DOMAIN: mx.example.com
ports:
- "25:25" # SMTP (explicit TLS => STARTTLS, Authentication is DISABLED => use port 465/587 instead)
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
- "465:465" # ESMTP (implicit TLS)
- "587:587" # ESMTP (explicit TLS => STARTTLS)
- "993:993" # IMAP4 (implicit TLS)
- "4190:4190" # SIEVE
volumes:
- ./docker-data/dms/mail-data/:/var/mail/
- ./docker-data/dms/mail-state/:/var/mail-state/
- ./docker-data/dms/mail-logs/:/var/log/mail/
- ./docker-data/dms/config/:/tmp/docker-mailserver/
- /etc/localtime:/etc/localtime:ro
- ../traefik/config/acme.json:/etc/letsencrypt/acme.json:ro
restart: always
stop_grace_period: 1m
cap_add:
- NET_ADMIN
healthcheck:
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
timeout: 3s
retries: 0
whoami:
image: docker.io/traefik/whoami:latest
labels:
- "traefik.http.routers.whoami.rule=Host(`mx.example.com`)"
- "traefik.http.routers.whoami.tls.certresolver=lets-encrypt"
restart: unless-stopped
š Relevant log output
May 7 23:37:09 mx postfix/postscreen[722801]: CONNECT from [64.147.123.154]:50973 to [172.20.0.3]:25
May 7 23:37:09 mx postfix/postscreen[722801]: PASS OLD [64.147.123.154]:50973
May 7 23:37:09 mx postfix/smtpd[722802]: warning: hostname wfhigh3-smtp.messagingengine.com does not resolve to address 64.147.123.154
May 7 23:37:09 mx postfix/smtpd[722802]: connect from unknown[64.147.123.154]
May 7 23:37:10 mx postfix/smtpd[722802]: Anonymous TLS connection established from unknown[64.147.123.154]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)
May 7 23:37:10 mx postfix/smtpd[722802]: A64AD29008B0: client=unknown[64.147.123.154]
May 7 23:37:10 mx postfix/cleanup[722808]: A64AD29008B0: message-id=<>
May 7 23:37:11 mx postfix/cleanup[722808]: A64AD29008B0: milter-reject: END-OF-MESSAGE from unknown[64.147.123.154]: 5.7.1 Spam message rejected; from=<hello@hello.asciinema.org> to=<my-email@example.com> proto=ESMTP helo=<wfhigh3-smtp.messagingengine.com>
May 7 23:37:11 mx postfix/smtpd[722802]: disconnect from unknown[64.147.123.154] ehlo=2 starttls=1 mail=1 rcpt=1 data=0/1 quit=1 commands=6/7
Improvements to this form?
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 45 (44 by maintainers)
Iād just like to thank you all. Thanks to your help the
asciinema.orgemails are now-2.18in SPAM score.Also I think that the underlying issue (DNS being messed up when using
hostname) option in Docker compose should be investigated. I might make a PR for docs so that the possibility of this issue is mentioned somewhere. Iāll try to gather some info on why this could happen but I cannot promise anything.Again, thanks for your help, youāre awesome.
@georglauterbach
Of course. Itās a simple email with a login link. You can also easily get one yourself by logging in/registering here: https://asciinema.org/login/new. Thereās no password or anything so itās not that annoying to make an account and test this out yourself.
The email (without the login token):
Source
Hopefully I didnāt leave anything sensitive in.
It shouldnāt at all. Itās just a nicer way to use
docker-composeas you have everything in an UI. Iāll try to look into it by copying the compose file and starting it outside of Portainer.Iāll try to spin up a new container. Iāll make a backup and try whether something in the volumes is messing this up by running it with the devault
mailserver.envand then with mine.Ok I thought that Iād give the
mailserver.envfile a quick test by passing it to the test container:docker run --rm -it --platform linux/arm64 --env-file mailserver.env mailserver/docker-mailserver apt updateBut everything works as expected so thatās not the issue.
Thanks for all your suggestions, help and explanations.
Honestly I didnāt realize this was still open.
Depending on who you ask, this is either not serious at all, or a deal-breaker. If you ask me, I think itās awful, and there is likely noting you can do when relying on an ISP. The ISP will not set a proper rDNS for you (kind of understandable).
I want to give a brief explanation of my point of view. In my
main.cf, I haveEither you are in
mynetworksor authenticated; otherwise you are checked. The first check,reject_unknown_reverse_client_hostnamewill reject the request āwhen the client IP address has no address -> name mappingā. If you do not have a PTR entry, you are rejected; youād not be rejected here.Others may use
reject_unknown_client_hostname, though. This is way stricter. According to the Postfix docs, this check rejects requests ifāThis is a stronger restriction than the
reject_unknown_reverse_client_hostnamefeature, which triggers only under condition 1) above.ā At this point, youāre done, and your mail would be rejected.Now,
reject_unknown_client_hostnameis tricky. You are very strict, but you risk loosing legitimate e-mails. Hence, most people usereject_unknown_reverse_client_hostnameand let anti-spam measures evaluate the fact that your rDNS may not exist (very bad), or that your rDNS may not match (bad). This increases your score, and hence the likelyhood of being greylisted, marked as spam, etc. - you name it.That being said, there is more to it. For example, whether the assumption that illegitimate e-mails have not PTR record still holds up in 2024. Depending on the link you click on, you get different answers.
Because https://github.com/asciinema/asciinema-server/issues/445 is resolved upstream, I will also close this issue. If youād like to go on with the discussion, feel free to use our discussions š
So it is local only? Now that I think of it though my DNS is one domain (the intended one) and the rDNS is a subdomain of my isp with the internal ip in it. How can I check whether that issue exists outside local emails?
I already prepared the issue and I linked to your comment where you explained the issues which I think you did pretty well. The issue is on my laptop though so Iāll post it later (on my phone RN).
Hi, I got into the WebUI of rspamd and I got some reasons for why was asciinema greylisted.
Hereās the report:
The email was resent and recieved in spam after the greylist expired.
The too early message was because I created a new login that sent a new email not because the mailserver resent it before the greylist period expired. The greylist since expired and I receive the emails now. Itās in spam with a score of 6.11 though. Iāll see why that is and whether thereās something to do about that. Maybe itās just because there were so many of what is basically the same email.
They are not equivalent since the docker option modifies the network/DNS server of the container while
OVERRIDE_HOSTNAMEis an option inside the container that does not modify the networking.I can try it once I have some free time.
In your containers, can you please run
to verify which DNS servers Rspamd is using. I also need
and the contents of what is in the
signedby=section, probably/etc/apt/trusted.gpg.d/rspamd.gpg. Iād also like to know what/etc/resolv.confcontains as well, just to double-check.TBH that would indicate network problems in your production container.
Using SA + OpenDKIM works now because SA is simply not performing the reverse-DNS-mismatch check this way (it does, but it does not add as much weight IIRC). Still, this is not necessarily a Rspamd problem.
That was one of the first things I tried but I can try again. I tried to update the container (this recreates it in Portainer), then it was recreated when I switched to
edgefromlatest.This system does not suspend at all. Itās a Raspberry Pi working 24/7 (I did update and restart it during these issues just in case there was something with the system).
Ok, I managed to setup spamassassin and opendkim. Opendkim even has my old key now (luckily itās not that hard to follow the files and the config) so Iām set up without any issues now.
I have both
.envfiles so I can easily switch between them for testing. Iāll be running spamassassin now, switching to rspamd only for testing and once itās fixed (Iād like to have the more lightweight thing).I know but
I use the v2 plugin, not the old binary:
If youād help me set up such environment Iāll gladly do so. Iām not that familiar with mailservers (thatās why I use DMS) but Iām happy to help.
AFAIK not that many people use asciinema. I reckon that a pretty small number of people that
The command you supplied doesnāt work as thereās no arm64 image. Also the repositoried in DMS image are broken so I cannot install
qin the container.I"ve set the container to use Cloudflare:
I think I encountered it, thatās why I have manually set 1.1.1.1 on some containers.
Iād rather not. I donāt know hot that config works and I donāt like running āspecializedā setups that I have to fix every major release.
Exactly what I predicted:
HFILTER_HOSTNAME_UNKNOWNmeans DNS didnāt work at the time of filtering the message. Thatās a common issue, but it means your setup is working fine per se. You probably need to double-check your DNS servers.Please have a look at the Rspamd log (our Rspamd docs describe the location) and see how such a score came to be. Post the result here, please.
I suspect a (temporary) DNS issue. A hostname mismatch causes a +6 in the spam score.
Why? Because of
wfhigh3-smtp.messagingengine.comdoes resolve to64.147.123.154. Reverse-DNS checks out, too.DNS is, in my experience, the most frequent source of errors. We have a dedicated section in our docs on this issue as well (with a big warning and error admonitions).
Could you please try reproduce the failure with the
:edgeimage? There was some rspamd fixes there that may have already addressed this.