Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a mail server running Postfix in my LAN with which I can send and receive emails in my LAN and send from the WAN to the LAN. I can't send from the LAN to the WAN though.

I am trying to use my ISP's relay host ( to solve this problem as it seems the simplest way (the relay doesn't require authentication).

With telnet I can connect directly to the relay host and send an email without authentication:

> telnet 25
Connected to
mail from:
250 Ok
rcpt to:
250 Ok
354 End data with <CR><LF>.<CR><LF>
This is a test
250 Ok: queued as 9BFD413BAE5

Trying to use the same relay on my postfix server gives me the Relay access denied error though (not sure which relay it means):

>telnet 25
mail from:
250 2.1.0 Ok
rcpt to:
554 5.7.1 <>: Relay access denied

My postfix configuration (

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname =
mydomain =
myorigin = $mydomain
smtpd_sender_restrictions = permit_mynetworks
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination =, ubuntu, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

Any ideas what can be wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Yes. Your server is denying relay to you. Because:

smtpd_sender_restrictions = permit_mynetworks
mynetworks = [::ffff:]/104 [::1]/128

So you have to add you IP range (the IP of your telnet client, for instance) to my_networks

mynetworks = [::ffff:]/104 [::1]/128

In case you telnet client's IP is

If your server is hosted on an ISP and you are using unknown dynamic IP range you will have to use SMTP authentication in your server. Or just leave your server as an open relay (which of course I wouldn't recommend).

share|improve this answer
Thank you! That solved it. I thought that was sufficient as I was telneting from localhost. –  Pithikos May 10 '14 at 13:27
But you wrote "telnet 25" and probably your telnet client bound it's socket to your local IP instead of local loopback ( You can check that by doing "telnet 25" without adding the IP to my networks. – May 10 '14 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.