Postfix refuse to send email from outside clients

0

I'm running an smtp server (postfix) inside kubernetes - the server is not accessible from outside the cluster.

Note: smtp2.XXX.eu is registered as MX entry, anyway gmail accepts mails in following commands.

On the smtp pod, I can do (replace XXX by my domain):

$ nc localhost 25
220 smtp2.XXX.eu ESMTP Postfix
helo client
250 smtp2.WWW.eu
mail from: norep@smtp2.XXX.eu
250 2.1.0 Ok
rcpt to: pafer@YYY.fr
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: toto
Well !
.
250 2.0.0 Ok: queued as A250367A7CE
quit
221 2.0.0 Bye

And I receive the email one second later.

Now, from another Pod:

$ nc ip-of-my-smtp-pod-or-service 25
# then here, exaclty the same commands

I've got no error. But email are not received. I've got a "connexion refused" on "XXX.eu" in the "defer" logs:

<norep@XXX.eu>: connect to XXX.eu[10.200.211.11]:25: Connection refused
recipient=norep@XXX.eu
offset=236
dsn_orig_rcpt=rfc822;norep@XXX.eu
status=4.4.1
action=delayed
reason=connect to XXX.eu[10.200.211.11]:25: Connection refused

Other try, instead of using noreply@XXX.eu I tried noreply@smtp2.XXX.eu and then the error is different

<norep@smtp2.XXX.eu>: alias database unavailable
recipient=norep@smtp2.XXX.eu
offset=248
dsn_orig_rcpt=rfc822;norep@smtp2.XXX.eu
status=4.3.0
action=delayed
reason=alias database unavailable

This is what does my entrypoint:

RELAY_HOSTNAME=${RELAY_HOSTNAME-smtp}
RELAY_DOMAINS= #Empty to relay all emails

# RELAY_HOSTNAME is smtp2.XXX.eu
postconf -e myhostname=${RELAY_HOSTNAME}

# RELAY_DOMAINS is empty
postconf -e relay_domains=${RELAY_DOMAINS}
postconf -e smtpd_sasl_auth_enable=no
postconf -e "mynetworks= 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 10.0.0.0/8"
postconf -# mydestination
postconf -F '*/*/chroot = n'
postconf -e smtpd_restriction_classes=verify_sender
postconf -e verify_sender=permit

Any idea to help me ? Thanks !

Metal3d

Posted 2019-05-27T17:09:32.660

Reputation: 136

No answers