NFTables, Mails


I try to get a look at your solution but I have few questions.
First one is about filtering on the firewall.
I see the cs-netfilter-blocker but this one use iptables.
But since debian 10 now they recommend using nftables.

Other question, I see no collecitons about postfix, dovecot or other mails solutions.

It’s my job to go to the documentation and write everything needed (and eventually share it here) or do you have plan to write those tools ?

Thank you for your feedback.

For now the only way to filter is iptables, and you are right since debian buster, nftables is recommended. Debian documentation ( tells us that nftables is the default backend when using iptables with debian buster, so I guess nftables is used when using debian 10. Nevertheless we planned to develop the same tool for nft directly.

It’s true that there’s no mail collection for now, and we’ll definitely welcome any useful contribution. What are the scenarios you would see useful regarding mails ? Maybe if you have some logs you may share with us, we can collaborate to have some collections written.

Thx for the answer.
I use postfix, dovecot. I use fail2ban to block too many auth failures, too many connection without any action and maybe spam (have to check).
Like that :
connect from unknown[xxx]
lost connection after AUTH from unknown[xxx]
disconnect from unknown[xxx] ehlo=1 auth=0/1 commands=1/2

connect from xxx[xxx]
lost connection after CONNECT from xxx[xxx]
disconnect from xxx[xxx] commands=0/0

or the postfix and dovecot filter on fail2ban.

All that can block IP sending spam, trying to brute force or check for open relays.

And about nftables yes on debian 10 when you use iptable you really use nftables.
It’s juste to have a script who directly use nftables :slight_smile:


We’ll try to provide some postfix scenarios very soon !

1 Like


We now have a postfix collection aimed at detecting spam attempt.

1 Like

oh nice, I will take a look at that.
My goal is to integer crowdsec to all my new server install with debian 11 during the 2021 summer.
I hope I will be able to replace fail2ban with that.

1 Like

Hi, can you add detection on the those event too ?

Oct 16 13:34:34 yoda postfix/smtpd[25340]: NOQUEUE: reject: RCPT from unknown[]: 554 5.7.1 xxx@xxx: Relay access denied; to=xxx@xxx proto=ESMTP helo=<>

Oct 16 13:27:33 yoda postfix/smtpd[29340]: NOQUEUE: reject: RCPT from unknown[]: 450 4.7.1 <>: Helo command rejected: Host not found; from=xxx@xxx to=xxx@xxx proto=ESMTP helo=<>

Oct 16 13:20:53 yoda postfix/smtpd[26160]: NOQUEUE: reject: RCPT from unknown[]: 504 5.5.2 : Helo command rejected: need fully-qualified hostname; from=xxxx@xxx to=xxx@xxx proto=ESMTP helo=

After that I miss dovecot, and I will be able to make some test on production server.
Do you prefer the fail2ban config file or some error log ?

Ok, I’ll add these as soon as possible, and update here.

We really love to have feedback on our scenario’s usefulness.

1 Like