email got "Remote host said: 554 5.7.1 Relay access denied

Hi,

I setup the Ubuntu  10.04 Server, Apache / Postfix / Dovecot / Squirrelmail, everything is ok except receiving emails from outside:

squirrelmail send emails to outside - OK

Outside (e.g. yahoo, gmail) send email to my email server  - not OK

For example, I use Yahoo send testing email to my email server, but bounce back and got following error message:

Remote host said: 554 5.7.1 <xxxxx@<mydomain>.com>: Relay access denied [RCPT_TO]

Is there any settings I need to change in Postfix or squirrelmail?
liyyAsked:
Who is Participating?
 
Sergey KolesnikConnect With a Mentor IT ManagerCommented:
Seems like that you need to change your main.cf file

The default that Virtualmin enters there usually is:

mydestination = {hostname.hostdomain.tld}, localhost.{hostdomain.tld} , , localhost

(On one line, no linebreak!)

Without that, Postfix does not know for which domains it is responsible, interprets mail that is supposed to go to local recipient as "relaying" (sending mail to another system), and denies that for non-authenticated users.

So if you would like to host domain test.com and subdomains test1.test.com, test2.test.com and test3.test.com this line should look like:

mydestination = test1.test.com, test2.test.com, test3.test.com, localhost.test.com, localhost, test.com
0
 
Dimitris IoakimoglouConnect With a Mentor Network AdministratorCommented:
have you added your own domain at the mydestination line?

http://www.postfix.org/BASIC_CONFIGURATION_README.html
0
 
liyyAuthor Commented:
XontrosAdmin and dreik

yes, I added them on the main.cf.

thanks all, I put the domain without ".com" on it, so it bounce back and shows "Relay access denied".

but when I correct them, I use Yahoo to send a email to my email server, no bounce back, but my email server didn't get any emails !!!

I use Squirrelmail to send internal users, same problem !!!!

I dump the main.cf list as below:

#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 = <hostname>.<mydomain>.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = <hostname>.<mydomain>.com, mail.<mydomain>.com, <mydomain>.com, localhost
relayhost =
mynetworks = 127.0.0.0/8, 192.168.2.0/24
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
liyyAuthor Commented:
I found that when I ssh to Ubuntu and then type mail on terminal, actually server got the emails, but it doesn't show on Squirrelmail !!!
0
 
Dimitris IoakimoglouNetwork AdministratorCommented:
when you say you didn't get an email, are you sure the server never got it or is it just the client that didn't download it?

then, I see you don't have myhostname set up, which will cause most anti-spam engines to reject your emails and cause other problems too
0
 
liyyAuthor Commented:
thanks XontrosAdmin

I found that the email store on mbox on their user's home folder !!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.