Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup postfix on ubuntu. I only want to allow sending of email from local connections with no authentication. When I try to send emails I'm getting the following errors:

550 5.1.1 <>: Recipient address rejected:
554 5.5.1 Error: no valid recipients

This error occurs no matter what the to address is set to. I've been testing with the following:

# telnet localhost 25

Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 ESMTP Postfix (Ubuntu)

ehlo localhost
mail from: root@localhost
rcpt to:
Subject: My first mail on Postfix

Are you there?
250-SIZE 10240000
250 DSN
250 2.1.0 Ok
550 5.1.1 <my_address@gmail.comt>: Recipient address rejected:
554 5.5.1 Error: no valid recipients
221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.

My file look like this:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = server.domain.comt
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, localhost
relayhost =
mynetworks =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = error
relay_transport = error
inet_protocols = ipv4

Not sure how to proceed as google has not turned up anything related to my issue.

share|improve this question

Normally this is a hostname/DNS issue. I'm assuming is not the actual hostname of the server, but make sure it is a proper FQDN. If it is not an internet facing server with a real external hostname, use a .local domain (I sometimes use .internal at home to avoid conflicting with zeroconf). Check your hosts file, /etc/hostname, /etc/mailname, and the values of myhostname, mydestination, myorigin.

Also in the config above there is a typo in myhostname.

share|improve this answer
Yes, is not the actual hostname :) There was a problem with the hostname, I've updated the the sever with the correct settings but it's still giving the same error as before – JamieD May 6 '11 at 10:13

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.