PDA

View Full Version : 554 5.7.1 <test@myotherdomain.com>: Relay access denied


mramin05
5th March 2009, 09:43
hi guys,
I have installed postfix and dovcot as the tutorial "The Perfect Server" in CentOS 5.2.
I can access to that remote server by ssh secure shell.
after completion I want to test my postfix.
This is my steps:



$>elnet mail.mydomain.com 25
Trying 222.99.123.211...
Connected to mail.mydomain.com.
Escape character is '^]'.
220 mail.mydomain.com ESMTP Postfix
mail from: testuser@mydomain.com
250 2.1.0 Ok
rcpt to: mramin05@yahoo.com
554 5.7.1 <mramin05@yahoo.com>: Relay access denied

If I use localhost instead of the mail.mydomain.com
then no problem at all.

# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.mydomain.com ESMTP Postfix
mail from: test@mydomain.com
250 2.1.0 Ok
rcpt to: mramin05@yahoo.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
.
250 2.0.0 Ok: queued as 0D504203C1
quit
221 2.0.0 Bye
Connection closed by foreign host.


here is my postconf -n result..

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_command =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = mydomain.com
myhostname = mail.mydomain.com
mynetworks = 222.99.123.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550


Please help me.
I have googled a lot but not found any answer.
Thx in advanced.
Amin

mirostz
5th March 2009, 18:12
hey dude,
I am not too good at it but i think your problem is at mydestination variable in main.cf

your relay access is denied because i guess at mydestination in main.cf you dont have mail.mydomain.com you have only localhost that's why u connect with localhost.

Add after localhost, mail.mydomain.com and u should be good. Cheers

mramin05
5th March 2009, 18:33
hi mirostz,
Thx for your reply.

Add after localhost, mail.mydomain.com and u should be good. Cheers

I have solved the relay problem by this way a hour earlier. Now my problem is
When I want to mail from local PC by ruby using my smtp server( remote) it create error. I am using user Authentication(login).here is setting

ActionMailer::Base.smtp_settings = {
:address => "mail.mydomain.com",
:port => 25,
:domain => "mydomain.com",
:user_name => "test",
:password => "xxxxxx",
:authentication => :login
}

But If it send mail from the server computer then it ok.
Is there any config problem?
Please help me.Thx in advance.

mirostz
5th March 2009, 21:35
hey dude,
Well i dont use ruby but try squirrelmail it is easy to install and it is with web interface very good mail program. you have already dovecot and postfix running so just install sqruirrelmail and have fun

falko
6th March 2009, 14:32
The problem is that you must authenticate if you're not sending from localhost.