[mail] How to Enter an IP or Email Address into Your Mail Server's Spam Filter

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.27
How are you able to access your server: The webadmin

Describe your issue

What’s the best way to block spam without compromising YunoHost? I need to add and block an IP address or email address. Thanks.

Share relevant logs or error messages

none

Googling i try this:
su
cd /var/mail/myusername
nano .dovecot.sieve

insert this content:

require [“fileinto”];
if address :is “from” “spam@spam.com” {
discard;
stop;
}

*** saving file ***

and then

sievec .dovecot.sieve

That’s all I’ve done, and I hope it’s correct. I’m a Linux newbie.
Thank you all.

Hey Stefano,

Nice start! :blush: Your Sieve rule looks correct for filtering specific sender addresses at the user level.

However, if you want to block spam server-wide (for all users), you might want to look at these options instead:

  • Postfix access lists — edit /etc/postfix/sender_access or /etc/postfix/client_access to block specific IPs or domains, then run postmap and reload Postfix.
  • Rspamd (built into YunoHost) — open https://yourdomain.tld/rspamd and add blacklists or custom rules. It’s a powerful way to handle spam scoring, greylisting, and IP reputation automatically.
  • Fail2Ban — double-check that your mail-related jails (like postfix, dovecot, and rspamd) are enabled. It helps block brute-force IPs.

Your current .dovecot.sieve solution works fine if you only want to silently discard specific senders in your own mailbox. :+1:

1 Like

rspamd seems intresting, but i’m not able to find it:
i try: mydomain.com/rspamd → page not found (mydomain is my wordpress/email domain)
https://yunodummy.nohost.me/yunohost/sso/rspamd
https://yunodummy.nohost.me/rspamd

but it doesn’t work

what is the right link?
Thank you!

You can find it in the app catalog

thank you, i downloaded rspamd and rspamdui.
Now (i hope) i will learn to use :slight_smile:
thank you very much

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.