I entered the following command as proof of concept
while :; do cat <(echo '220 filtro.catorcio.tld ESMTP Postfix') | nc -l
127.0.0.1 10025 < /dev/stdin; done
but it seems postfix tries to resolve localhost with a dns lookup so it
fails, definitily not what I want.
Oct 20 13:03:10 webhat postfix/smtp: 65C1B20816C6:
to=<[hidden email]>, relay=none, delay=0.38, delays=0.25/0.11/0.02/0,
dsn=5.4.4, status=bounced (Host or domain name not found. Name service error
for name=localhost type=AAAA: Host not found)
I read the syntax of next hop in smtp man page and I solved changing the
directive in main.cf as
In the readme they define the service on the port 10025 directly in the master.cf using the spawn utility, maybe the smtp agent doesn't lookup a dns record if it finds the next host defined in the service column of master.cf. Unfortunately now I'm in the office and I have to wait to have further fun with postfix but the smtp_host_lookup will surely solve the problem.