roehling / postsrsd

Postfix Sender Rewriting Scheme daemon
324 stars 39 forks source link

Prevent forwarding spam #180

Closed mdbraber closed 3 months ago

mdbraber commented 3 months ago

When forwarding messages with OpenSRSd it can happen that messages are forwarded that are essentially spam. Because of SRS; they are often not noted as spam (anymore) by the receiver because the sender (and SPF) is valid. But it can also mean that they are noted as spam and tarnish the reputation of my forwarding host (although it's 'only' forwarding the spam;)

I could resort to running a anti-spam daemon (e.g. rspamd) to prevent spam being forwarded, but I'd rather leave this up to the receiver. This is somewhat similar to the situation here: https://github.com/roehling/postsrsd/issues/10#issuecomment-43734301

Is there any recommended way to deal with (possibly) forwarding spam? Should I run anti-spam measures on the forwarding host or is there a configuration option that I could / should set to better deal with this? Thanks!

roehling commented 3 months ago

In my experience, virtually all spammers use throw-away domains now, which SPF-validate correctly. SPF and DMARC are useful because spammers can no longer fake email from reputable sources, but I sincerely doubt you will catch much spam with an SPF check these days.

That being said, the SPF check is really not that expensive computationally and easily integrated into Postfix using postfix-policyd. I understand that a full-blown anti-spam solution may be overkill for your setup, but you do not need that to address your concern; verifying SPF is enough to prevent accidental "laundering", and you can leave the more sophisticated spam detection methods to the recipient.

mdbraber commented 3 months ago

Thanks. My main concern is mostly 'damaging' my IP reputation by forwarding spam. I think you mean I should just check SPF for the sender of the mail to be forwarded? I'm already doing that - although I think that might still be limited as SPF might just check out, while e.g. content clearly indicates SPAM (and gets linked to my IP / server having forwarded that mail). I've gone the rspamd route now and that's working good enough. I'll close this issue for now. Thanks!