Rspamd segfault and no dkim signature on output mail

Hi, I have a DKIM problem when sending email, don’t know really since when as I have been lazy about it for a long time.

My YunoHost server

Hardware: Odroid hc4
YunoHost version: 11.2.11.3 (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Trying to send an email, it appears that the mail is not signed with DKIM as I can see on mail-tester report, and on some services sending me dmarc reports.

I’ve been investigating a little bit, and I faced different problems. First one it seems that one day, don’t really know when and how the default dkim domain key disappeared from /etc/dkim folder.
I found it with the following log line :

2024-04-30 20:00:54 #2906834(normal) <439d7c>; task; dkim_module_load_key_format: cannot load dkim key /etc/dkim/quiwy.ninja.mail.key: cannot stat key file: '/etc/dkim/quiwy.ninja.mail.key' No such file or directory

After creating the key, following these script lines ; I had permissions problems, with the following log :

2024-04-30 20:38:05 #2925441(normal) <3e62b5>; task; dkim_module_load_key_format: cannot load dkim key /etc/dkim/quiwy.ninja.mail.key: cannot map key file: '/etc/dkim/quiwy.ninja.mail.key' Permission denied

I fixed it reading the same script as above, just a few lines later.

Now, I guess it should be working, but I have a rspamd segfault when sending an email.
Doesn’t know really what happens, and what I can do to fix it.

The logs are the following :

2024-04-30 23:24:03 #2934978(rspamd_proxy) <0c285f>; proxy; proxy_backend_master_error_handler: retry connection to: ::1 retries left: 1
2024-04-30 23:24:03 #2934974(main) <33e215>; main; rspamd_check_termination_clause: normal process 2971074 terminated abnormally with exit code 0 by signal: Segmentation fault but NOT created core file (throttled=no); core file limits: 0 current, -1 max
2024-04-30 23:24:03 #2934974(main) <33e215>; main; rspamd_cld_handler: respawn process normal in lieu of terminated process with pid 2971074
2024-04-30 23:24:04 #2934974(main) <33e215>; main; rspamd_fork_worker: prepare to fork process normal (0); listen on: localhost:11333
2024-04-30 23:24:04 #2971081(normal) <33e215>; main; rspamd_worker_set_limits: use system max file descriptors limit: 1024KiB cur and 1024KiB max
2024-04-30 23:24:04 #2971081(normal) <33e215>; main; rspamd_worker_set_limits: use system max core size limit: 0B cur and -1B max
2024-04-30 23:24:04 #2971081(normal) <33e215>; main; rspamd_handle_child_fork: starting normal process 2971081 (0); listen on: localhost:11333
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; cfg; rspamd_dns_resolv_conf_on_server: parsed nameserver 127.0.0.1 from resolv.conf
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; cfg; rspamd_dns_read_hosts_file: processed host file /etc/hosts; 7 records added
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_SPAM
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_HAM
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; reputation.lua:1284: Enable ip (redis backend) rule for symbol SENDER_REP (split symbols: true)
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 5, sha: 3356099ff58c7e8893283c259278305d0d813a84
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 2, sha: a43800941e2820ed8d764d50dfd9c142beddde68
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 1, sha: b2b5aaa894dc3056e6ac294e44adbd0a1ca702b6
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 3, sha: 3b7b7539e4555fa579ead520dcc3a85d8a25ceab
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 4, sha: e7a1e089124abbfb1f68ecf1d1da3ac41d4f86a3
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 6, sha: da3a534c5a16cf973cfab2ba50c1fb8461a87093
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 7, sha: 1175ee2e472572347a0440dfc3c12b841a3c420e
2024-04-30 23:24:04 #2971081(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 8, sha: 472e78542027296b2d57f5dfbda448c3cf8619d9
2024-04-30 23:24:04 #2971081(normal) <604bc7>; task; rspamd_worker_body_handler: accepted connection from ::1 port 41636, task ptr: 0000FFFF86EE78A0
2024-04-30 23:24:05 #2971081(normal) <604bc7>; task; rspamd_message_parse: loaded message; id: <a885f36e-4fba-4a5e-8498-be0294b812cf@quiwy.ninja>; queue-id: <6A40DB9FAE84>; size: 115716; checksum: <26bb4aa49dfd637e1a586d4e7efe905b>
2024-04-30 23:24:05 #2971081(normal) rspamd_crash_sig_handler: caught fatal signal 11(Segmentation fault), pid: 2971081, trace:
2024-04-30 23:24:05 #2971081(normal) rspamd_print_crash: 0: 0000FFFF8A08F910: <unknown>
2024-04-30 23:24:05 #2971081(normal) rspamd_print_crash: 1: 00000846DB35BBC8: <unknown>
2024-04-30 23:24:05 #2971081(normal) rspamd_crash_sig_handler: please see Rspamd FAQ to learn how to dump core files and how to fill a bug report
2024-04-30 23:24:05 #2934978(rspamd_proxy) <0c285f>; proxy; proxy_backend_master_error_handler: abnormally closing connection from backend: [::1]:11333, error: IO read error: unexpected EOF, retries left: 0
2024-04-30 23:24:05 #2934978(rspamd_proxy) <0c285f>; proxy; proxy_backend_master_error_handler: cannot connect to upstream, maximum retries has been reached: 5
2024-04-30 23:24:05 #2934974(main) <33e215>; main; rspamd_check_termination_clause: normal process 2971081 terminated abnormally with exit code 0 by signal: Segmentation fault but NOT created core file (throttled=no); core file limits: 0 current, -1 max
2024-04-30 23:24:05 #2934974(main) <33e215>; main; rspamd_cld_handler: respawn process normal in lieu of terminated process with pid 2971081
2024-04-30 23:24:05 #2934974(main) <33e215>; main; rspamd_fork_worker: prepare to fork process normal (1); listen on: localhost:11333
2024-04-30 23:24:05 #2971085(normal) <33e215>; main; rspamd_worker_set_limits: use system max file descriptors limit: 1024KiB cur and 1024KiB max
2024-04-30 23:24:05 #2971085(normal) <33e215>; main; rspamd_worker_set_limits: use system max core size limit: 0B cur and -1B max
2024-04-30 23:24:05 #2971085(normal) <33e215>; main; rspamd_handle_child_fork: starting normal process 2971085 (1); listen on: localhost:11333
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; cfg; rspamd_dns_resolv_conf_on_server: parsed nameserver 127.0.0.1 from resolv.conf
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; cfg; rspamd_dns_read_hosts_file: processed host file /etc/hosts; 7 records added
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_SPAM
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_HAM
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; reputation.lua:1284: Enable ip (redis backend) rule for symbol SENDER_REP (split symbols: true)
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 5, sha: 3356099ff58c7e8893283c259278305d0d813a84
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 2, sha: a43800941e2820ed8d764d50dfd9c142beddde68
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 1, sha: b2b5aaa894dc3056e6ac294e44adbd0a1ca702b6
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 8, sha: 472e78542027296b2d57f5dfbda448c3cf8619d9
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 3, sha: 3b7b7539e4555fa579ead520dcc3a85d8a25ceab
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 4, sha: e7a1e089124abbfb1f68ecf1d1da3ac41d4f86a3
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 6, sha: da3a534c5a16cf973cfab2ba50c1fb8461a87093
2024-04-30 23:24:05 #2971085(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 7, sha: 1175ee2e472572347a0440dfc3c12b841a3c420e
2024-04-30 23:24:07 #2934974(main) <33e215>; main; rspamd_fork_worker: prepare to fork process normal (0); listen on: localhost:11333
2024-04-30 23:24:07 #2971096(normal) <33e215>; main; rspamd_worker_set_limits: use system max file descriptors limit: 1024KiB cur and 1024KiB max
2024-04-30 23:24:07 #2971096(normal) <33e215>; main; rspamd_worker_set_limits: use system max core size limit: 0B cur and -1B max
2024-04-30 23:24:07 #2971096(normal) <33e215>; main; rspamd_handle_child_fork: starting normal process 2971096 (0); listen on: localhost:11333
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; cfg; rspamd_dns_resolv_conf_on_server: parsed nameserver 127.0.0.1 from resolv.conf
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; cfg; rspamd_dns_read_hosts_file: processed host file /etc/hosts; 7 records added
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_SPAM
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; cfg; rspamd_stat_init: added backend redis for symbol BAYES_HAM
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; reputation.lua:1284: Enable ip (redis backend) rule for symbol SENDER_REP (split symbols: true)
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 5, sha: 3356099ff58c7e8893283c259278305d0d813a84
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 2, sha: a43800941e2820ed8d764d50dfd9c142beddde68
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 1, sha: b2b5aaa894dc3056e6ac294e44adbd0a1ca702b6
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 3, sha: 3b7b7539e4555fa579ead520dcc3a85d8a25ceab
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 4, sha: e7a1e089124abbfb1f68ecf1d1da3ac41d4f86a3
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 6, sha: da3a534c5a16cf973cfab2ba50c1fb8461a87093
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 7, sha: 1175ee2e472572347a0440dfc3c12b841a3c420e
2024-04-30 23:24:07 #2971096(normal) <tg4zmy>; lua; lua_redis.lua:1207: uploaded redis script to 127.0.0.1:6379 with id 8, sha: 472e78542027296b2d57f5dfbda448c3cf8619d9

Do you have any clue on what I could try to fix it? I had a 10/10 mail-tester score when first installing the server, but it was 4 or 5 years ago.

Any help would be appreciated :smile: