LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-21-2015, 02:14 AM   #1
mukulmanitiwari
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Rep: Reputation: Disabled
Postfix mail problem in rhel6, Error - Relay access denied


Hi,
I have configured a postfix mail server on RHEL6. It's working fine locally but when I am sending mail to gmail or yahoomail an error is coming "Relay Access Denied".
Postfix version - Postfix-2.6.6-2.2e16_1.x86_64

My host name - mail1.xyz.ac.in (xyz is not the real domain name)
IP address - 172.16.1.12

[root@mail1 ~]# 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
data_directory = /var/lib/postfix
debug_peer_level = 2
header_checks = regexp:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 20485760
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = xyz.ac.in
myhostname = mail1.xyz.ac.in
mynetworks = 172.16.1.0/29, 127.0.0.0/8,
mynetworks_style = subnet
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
smtpd_client_restrictions = warn_if_reject permit_mynetworks, reject_unknown_client,permit
smtpd_recipient_restrictions = warn_if_reject permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt
smtpd_tls_key_file = /etc/pki/tls/certs/server.key
smtpd_tls_loglevel = 1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
smtpd_tls_session_cache_timeout = 3600s
soft_bounce = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

[root@mail1 ~]# telnet mail1.xyz.ac.in 25
Trying 172.16.1.12...
Connected to mail1.xyz.ac.in.
Escape character is '^]'.
220 mail1.xyz.ac.in ESMTP Postfix (2.6.6)
ehlo localhost
250-mail1.xyz.ac.in
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root@root.ac.in
250 2.1.0 Ok
rcpt to: user.name@gmail.com
454 4.7.1 <user.name@gmail.com>: Relay access denied
quit
221 2.0.0 Bye
Connection closed by foreign host.
[root@mail1 ~]#
 
Old 09-21-2015, 03:29 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
I had a similar problem years ago when I was using a dynamic IP.

My ISP was refusing my email as the reverse lookup on my dynamic IP was theirs (I did own the domain though)

I figured that if Thunderbird could send mails from my desktop using the same connection, my server must be able to as well.

Thus using the
Quote:
relayhost = my_isp_mail_servers.com
as my relay host, mail was accepted by them and passed along.

Don't know if your problem is the same, but have a look at 'relayhost= ' in main.cf

Might give you some ideas
 
Old 09-21-2015, 04:01 AM   #3
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
If you are not connecting from $mynetworks then you need to authenticate before relaying is allowed.
Also, your *_restrictions clauses look to be missing some ,s.
 
Old 09-21-2015, 04:37 AM   #4
mukulmanitiwari
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for reply

Sir I have checked relayhost = ip.addr.host. but find same error.
If I connect with public ip find another error -
[root@mail1 ~]# telnet Public.ip.addr.x 25
Trying Public.ip.addr.x...
Connected to Public.ip.addr.x.
Escape character is '^]'.
220 mail1.xyz.ac.in ESMTP Postfix (2.6.6)
ehlo localhost
250-mail1.xyz.ac.in
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root@xyz.ac.in
250 2.1.0 Ok
rcpt to: user.name@gmail.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
testing mail
.
250 2.0.0 Ok: queued as 064751C0050

Kindly help me.
 
Old 09-21-2015, 04:56 AM   #5
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
That's very bad - it means you are an open relay and will be sendin volumes of spam in a few minutes and will likely be blacklisted for a very long time.
Shut down the public access immediately, until you work out how to run an SMTP server.
Read this - http://postfix.state-of-mind.de/patr...tter/smtpauth/
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use postfix send mail return 'relay access denied' ??need help!! xiaolong85 Linux - Server 6 01-24-2010 12:36 PM
Postfix+Dovecot error : RELAY ACCESS DENIED when send mail out to Other domain simon.unix Linux - Networking 6 09-16-2009 10:54 AM
Postfix Relay access denied outgoing mail alitrix Linux - Server 2 06-14-2008 03:38 PM
Postfix: Relay access denied whenever sending e-mail Doug52392 Linux - Server 1 11-11-2007 04:21 AM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 07:15 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration