this post was submitted on 21 Jan 2025
16 points (100.0% liked)

Selfhosted

41630 readers
560 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi,

I'm trying and failing to get spamassassin to load user prefs from a mysql database. I'm using spamass-milter and I can't find any way in the docs to send anything. spamass fails to parse the recipient as the user and just uses it's running user in it's call to spamd. The database is properly configured and I can connect and set settings from roundcube. The sql config is added to local.cf.

I know that you can use spamd as a pipe, and then you can pass more variables, but I can't figure out the correct config for this setup.

This is what I have in /etc/default/spamd: OPTIONS="-Q -x --max-children 5 -D sql,bayes -H /etc/mail/spamassassin/" I've also tried multiple combinations with the flags -q, without -x...

And this is what I have in /etc/default/spamass-milter OPTIONS="-u spamass-milter -x -i 127.0.0.1" Where again I've tried without -u, with -e domain.com to explicitly set the domain.

If anyone has any advice or can point me to a recent tutorial for Ubuntu 24.04, I would be really grateful!

top 8 comments
sorted by: hot top controversial new old
[–] Reven 4 points 1 week ago

I think I got it working. I've got this in /etc/default/spamd:

OPTIONS="-x -q -u spamd --max-children 5 -H /etc/mail/spamassassin/"

and this in /etc/default/spamass-milter:

OPTIONS="-e example.com -u spamass-milter -i 127.0.0.1"

And it definitely reads user prefs from the database because I can change the 'required_hits' to 6.7 for a given user and I see this in the logs:

spamd[523771]: spamd: clean message (-0.2/6.7) for [email protected]:133 in 1.2 seconds, 24427 bytes.

I don't know how many different combinations of config flags I've tried, but these seem to do the job.

[–] TCB13 3 points 1 week ago (1 children)
[–] Reven 2 points 1 week ago (2 children)

Yup, this is the last time I muck around with spamassassin unless the project gets a magical revival.

[–] pHr34kY 1 points 1 week ago

I don't even use it. Once I got SPF/SSL/DKIM/DMARC working, there was less spam than what I get on gmail.

[–] just_another_person -4 points 1 week ago (2 children)

Just don't even invite this mess to begin with. Let pros handle it.

[–] [email protected] 4 points 1 week ago

This is the SelfHosted community.

[–] Reven 1 points 1 week ago
[–] just_another_person 0 points 1 week ago