Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 <my_address@gmail.com>: Recipient address rejected: gmail.com
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...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 server.domain.com ESMTP Postfix (Ubuntu)

ehlo localhost
mail from: root@localhost
rcpt to: my_address@gmail.com
data
Subject: My first mail on Postfix

Hi,
Are you there?
regards,
Admin
.
quit250-server.domain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
250 2.1.0 Ok
550 5.1.1 <my_address@gmail.comt>: Recipient address rejected: gmail.com
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 main.cf 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_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
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 = server.domain.com, localhost
relayhost =
mynetworks = 127.0.0.0/8
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

1 Answer 1

Normally this is a hostname/DNS issue. I'm assuming server.domain.com 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, server.domain.com 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

 
discard

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.