Took me a whole day to figure out, how the url_redirector proper works. For those, who are interested:
proxmox 8.4.1
debian vm: /etc/debian_version 12.10
mailcow: 2025-03b
rspamd: 3.11.1
- create a file in in local.d/ as url_redirector.conf:
# How many urls to check
max_urls = 5;
# Maximum body to process
max_size = 10k;
# Follow merely redirectors
redirectors_only = true;
# Redis key for top urls
top_urls_key = ‘rdr:top_urls’;
# How many top urls to save
top_urls_count = 200;
# Check only those redirectors
redirector_hosts_map = “${LOCAL_CONFDIR}/local.d/maps.d/redirectors.inc”;
Take care for the owner settings of the file.
in rspamd admin –> symbols –> multimap REDIRECTOR_URL The presence of a redirector in the mail –> score this one with i.e. “5” (depending on your general settings). Save it.
Here’s a cavecat: if you send from a sogo contact a test email with i.e. "<a href=“https://bit.ly/lalelu">google.de</a>“ you’d expect, to get a soft-reject, greylist or a reject. BUT SOGO_CONTACT has per default a score of ”-99.0″. So trusting your sogo contacts could compromise your system. To me this logic does not really making sense to trust a sogo contact of a user, does it?
Now the struggle begins:
a) in rspamd admin –> symbols –> sogo –> score both one with i.e. “-1.0” (depending on your general settings). Save it. But not helping (alone?).
b) in local.d/groups.conf change the SOGO_CONTACT score to “-1.0”. Not helping (alone?).
c) in rspamd/dynmaps/settings.php find SOGO_CONTACT and score it to “-1.0”. Helps.
Did a) - c) always with a docker compose restart rspamd-mailcow
To be safe restart the whole cow with docker compose down and docker compose up -d.
Send a test email from a sogo contact. The logs are showing something like this:
“rspamd-mailcow-1 | 2025-05-13 20:05:17 #40(normal) <33A3D1>; task; rspamd_task_write_log: id: 8ed92e1cf39141548488876d2fd8f279@kabelbw.de, qid: <33A3D14276A>, ip: 14.25.28.66, from: x.y@kabelbw.de, (default: F (soft reject): [7.17/9.00] [REDIRECTOR_URL(5.00){bit.ly;},BAD_REP_POLICIES(3.00){},DWL_DNSWL_LOW(-1.00){kabelbw.de:dkim;},SOGO_CONTACT(-1.00){},…”
As bit.ly is in the redirector_map this one gets a score of “5.0” from the REDIRECTOR_URL. And the sogo contact get a score of “-1.0” from the SOGO_CONTACT symbol.
The mail is as expected soft rejected.
Maybe I overlooked something. If there is a more simple way, I’d like to know. What I also don’t know, if this survives an update. We’ll see.
Generally spoken, I’d never give a user email contact a trust-score of -99.0. Why should I? Who knows all about his email contacts and the IT behind.