Thank you for the reply.
I’m not a developer so I’m not extremely expert in server and in programming but I have a sort of passion.
I checked and I can see Proctmail is used … I was not aware of this.
As you say maybe there is a custom way to customize and ask to Proctmail to refuse a virus email after Postfix accept it.
How Procmail Works
Procmail only works during local delivery.
It cannot reject emails during the SMTP session.
This means that Postfix must first accept the email.
Only then can Procmail decide whether to save, move, trash, or generate a bounce.
In practice, if you try to use Procmail for viruses:
The email enters the server (Postfix receives it).
Procmail analyzes it and rejects it if it contains a virus.
The sender will receive a bounce after the email is accepted.
With Milter (example Milter ClamAV) , however, the SMTP rejection is immediate, the sender receives the rejection message immediately, and the email does not enter the server.
The following is a supposition, not sure it will works:
Virus rejection example with Procmail + ClamAV
:0
* ? clamscan --stdout --no-summary - < $RECIPIENT
{
LOG="Mail refused: virus detected"
EXITCODE=67
}
The email is passed to clamscan.
If ClamAV detects a virus → EXITCODE=67 → Postfix generates bounces.
Problem: All emails go through Procmail and ClamAV for delivery → less efficient than a Milter that blocks everything at the SMTP level.
Conclusion
Pros: You can reject emails and generate bounces without Milter.
Cons:
Post-delivery rejection (mail enters the server).
Requires writing rules and wrappers for all viruses.
More complex and less efficient.
Verdict: If you want security and immediate bounces, Milter ClamAV is the best choice.
If you just want additional filtering on local emails, Procmail can be used.
Maybe I have to keep as is now: virus email silently deleted or should try with a Milter but this can be risky as I’m in a production server.
Thank anyway for your reply, time and help 