I'm trying to build a system that analyzes incoming emails and automatically removes emails that fail permanently. But I never receive those emails that you usually receive when you send an email to an address that is not valid.
To test my system I use the command
mail -s "test mail" validemail@free.fr
I receive the email on my mailbox validemail@free.fr from root@myserverdomain.com
I reply to root@lyserverdomain.com to say hello, and I receive the email on myserverdomain.com.
Then I try this :
mail -s "test mail" invalidemaillllllllllllllllllllllllllllllllllllll@free.fr
And I never receive this email that tells you it's not a valid address.
If I'm sending an email from a "classic" email client (gmail for example) to invalidemaillllllllllllllllllllllllllllllllllllll@free.fr, I receive almost immediately this email telling me it's not a valid address.
So am I missing something? I think yes.
I'm using Postfix latest version on debian. It's configured on port 6666 (not 25 actually). I'm using another smtp server on the same machine on port 25, it's a python script that receives external emails and analyzes them.