Development System & Network

Postfix smtp relay can send emails but not relay other hosts

Use Case: We have several Eaton PDU/PSUs that don’t support SSL/TLS authentication. I was tasked with building a SMTP relay server that can take the basic SMTP/25 emails and forward them to our email provider via SSL.

Note: The relay host makes the smtps connectione on 465 using stunnel.

I am at a point where my SMTP Postfix Relay Server is able to send mail successfully via our email provider, alimail. But I cannot get it to relay emails from other hosts on our network.


smtpd_banner = mail01v-la ESMTP
inet_interfaces = all
inet_protocols = ipv4

mynetworks =,
relayhost = []:5000
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = no
smtp_generic_maps = regexp:/etc/postfix/generic






client = yes
foreground = no

accept = 5000
connect =

SMTP Telnet to Provider

[root@mail01v-la ~]# telnet smtp
Connected to
Escape character is '^]'.
220 MX AliMail Server
ehlo google.come
250 DSN

Checking Stunnel Connection

[root@mail01v-la ~]# telnet 5000
Connected to
Escape character is '^]'.
220 MX AliMail Server

Sending an Email from the Relay Server

echo "Stack Body" | mail -s "Test Subject for Stack"


Feb 14 18:30:29 mail01v-la postfix/pickup[4812]: 3194940DE2: uid=0 from=<root>
Feb 14 18:30:29 mail01v-la postfix/cleanup[4865]: 3194940DE2: message-id=<>
Feb 14 18:30:29 mail01v-la postfix/qmgr[2606]: 3194940DE2: from=<>, size=481, nrcpt=1 (queue active)
Feb 14 18:30:30 mail01v-la postfix/smtp[4867]: 3194940DE2: to=<>, relay=[]:5000, delay=1.3, delays=0.01/0.01/0.85/0.46, dsn=2.0.0, status=sent (250 Data Ok: queued as freedom)
Feb 14 18:30:30 mail01v-la postfix/qmgr[2606]: 3194940DE2: removed

Testing with other hosts

Random CentOS Server


relayhost = []:5000


Feb 14 18:06:52 test01v-la postfix/pickup[1247]: BB87C305A42F: uid=0 from=<root>
Feb 14 18:06:52 test01v-la postfix/cleanup[1387]: BB87C305A42F: message-id=<>
Feb 14 18:06:52 test01v-la postfix/qmgr[1248]: BB87C305A42F: from=<>, size=477, nrcpt=1 (queue active)
Feb 14 18:06:53 test01v-la postfix/smtp[1389]: BB87C305A42F: to=<>, relay=[]:5000, delay=0.78, delays=0.01/0.01/0.61/0.15, dsn=5.0.0, status=bounced (host[] said: 553 authentication is required (in reply to MAIL FROM command))

Eaton PSU


Eaton Result

email[17131]: message error -110 in function smtp_start_session test - (Connection timed out) retrying smtp_start_session test email[17131]: Failed to connect to SMTP server with username


This is my first time doing a setup like this. Theres likely a lot of holes in my knowledge that are causing me grief.

  1. In a proper setup, do you even need to re-type credentials for any hosts that want to use the relay server? For example, in the eaton smtp config, should it be the creds of the email used in the sasl file? Or a system account permitted for forwarding with postfix? Or an account name defined in the postfix/generic file? A bit lost.

  2. Is stunnel even the proper way I should be connecting via ssl/tls? I see starttls available in the telnet prompt for

Honestly, I think I’m overcomplicating this or am missing something obvious. If anyone has a better setup to accomodate my use case, it be greatly appreciated as well.

Leave a Reply

Your email address will not be published. Required fields are marked *