On Monday, February 1, 2021 4:32:21 AM EST Jonathan Sélea wrote: > Hi everyone, > > We currently have a webhosting-environment with many websites. Those > websites is capable of sending email (obviously) via the local SMTP > function. > But sometimes, some of the websites is compromised and used to send > quite alot of spam from the websites - often using random domains. > > So, one of the "solution" would be to implmement some kind of filter, > that check the SPF of the domains on outgoing emails and check if they > include or contain the IP or network of our environment and if not, the > emails is just discarded. > Ofcourse, we would employ more anti-spam features, but this would be > only one of them and could probably save us from blacklisting in some > cases. > > Thankful for your answers!
You can use the policy server interface with SPF Engine (formerly known as pypolicyd-spf) [1] to do a "Prospective SPF Check" (see policyd-spf.conf (5)). This checks if an email would pass SPF when received if it were sent from the current host. If I understand your question correctly, this is what you are asking for. This can be installed from source, via pypi, or via you system package manager (in many cases). Scott K [1] https://launchpad.net/spf-engine