Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th February 2009, 19:06
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default SMTP: Relay access denied

Hi guys

I have some problem with the SMTP server. I have followed the CentOs tutorial on this site.

The problem is send the email to an external domain.
I have already read the last post but I have not found any solution.

Code:
helo mail.mydomain.com
mail from:<web2_info@mydomain.com>
rcpt to:<test@gmail.com>
data
subject: This is a test mail
to: recipientname@mydomain.com
This is the text of my test mail.
.

Code:
220 myserver.mydomain.com ESMTP Postfix
helo mail.mydomain.com
mail from:<web2_info@mydomain.com>
rcpt to:<test@gmail.com>
data
subject: This is a test mail
to: recipientname@mydomain.com
This is the text of my test mail.
.250 myserver.mydomain.com
250 2.1.0 Ok
554 5.7.1 <test@gmail.com>: Relay access denied
554 5.5.1 Error: no valid recipients
221 2.7.0 Error: I can break rules, too. Goodbye.
Maillog
Code:
Feb 19 19:01:50 myserver postfix/smtpd[14596]: NOQUEUE: reject: RCPT from host84-42-dynamic.183-80-r.retail.telecomitalia.it[80.183.42.84]: 554 5.7.1 <test@gmail.com>: Relay access denied; from=<web2_info@mydomain.com> to=<test@gmail.com> proto=SMTP helo=<mail.mydomain.com>
Code:
[root@myserver ~]# 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 = /etc/postfix/local-host-names
myhostname = myserver.mydomain.com
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relayhost = mail.mydomain.com
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
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
any idea?
Reply With Quote
Sponsored Links
  #2  
Old 20th February 2009, 03:36
Angelito Angelito is offline
Junior Member
 
Join Date: Jan 2008
Location: Los Angeles,CA (US)
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Authentication needed ?

You might have to authenticate yourself first,
try:
Code:
EHLO mail.mydomain.com
and look for something like this:

Quote:
AUTH PLAIN LOGIN
If you see anything that starts with AUTH, it means you will have to supply a username and password.

Try that

Angel
Reply With Quote
  #3  
Old 20th February 2009, 09:30
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Quote:
helo mail.mydomain.com
220 myserver.mydomain.com ESMTP Postfix
EHLO mail.mydomain.com
250-myserver.mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

mail from:<web2_info@mydomain.com>
250 2.1.0 Ok
rcpt to:<test@gmail.com>
554 5.7.1 <test@gmail.com>: Relay access denied
.
.
.
.
but the problem persist
nothing to do
Reply With Quote
  #4  
Old 20th February 2009, 09:46
Angelito Angelito is offline
Junior Member
 
Join Date: Jan 2008
Location: Los Angeles,CA (US)
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default You MUST first supply a user name and a password.

Your post confirms what I said, you are being required to authenticate yourself.
Most likely the server is set to use AUTH LOGIN if so type in right after EHLO:

Code:
AUTH LOGIN
then you should get:

Code:
VXN1cm5hbWU6
which stands for username, then you should supply your email address encoded in base64. Then you will be required for your password encode it and send it as well.

Good luck.
Reply With Quote
  #5  
Old 20th February 2009, 10:14
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Quote:
Originally Posted by Angelito View Post
Your post confirms what I said, you are being required to authenticate yourself.
Most likely the server is set to use AUTH LOGIN if so type in right after EHLO:

Code:
AUTH LOGIN
then you should get:

Code:
VXN1cm5hbWU6
which stands for username, then you should supply your email address encoded in base64. Then you will be required for your password encode it and send it as well.

Good luck.

Code:
220 myserver.mydomain.com ESMTP Postfix
helo mail.mydomain.com
250 myserver.mydomain.com
EHLO mail.mydomain.com
250-myserver.mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
334 UGFzc3dvcmQ6
xxxxxxxxxxxx
235 2.0.0 Authentication successful
mail from:<web2_info@mydomain.com>
250 2.1.0 Ok
rcpt to:<test@gmail.com>
250 2.1.5 Ok
data
subject: This is a test mail
to: recipientname@mydomain.com
This is the text of my test mail.
.354 End data with <CR><LF>.<CR><LF>

Ok I have not understood. Now the email seems to me accepted but I don't receive nothing. what happens now? Any idea?

thanks
Reply With Quote
  #6  
Old 20th February 2009, 16:36
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Now in the log file I can see:

Code:
Feb 20 16:29:39 myserver postfix/qmgr[28529]: 8ED615300AE: to=<test@gmail.com>, relay=none, delay=0.65, delays=0.65/0.01/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for mail.mydomain.com loops back to myself)
any idea?
Reply With Quote
  #7  
Old 20th February 2009, 18:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Please add mail.mydomain.com to /etc/postfix/local-host-names and restart Postfix.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 20th February 2009, 19:52
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Hi Falko,

the problem persists.

Code:
Feb 20 19:50:19 myserver postfix/smtp[21789]: 246A3530088: to=<test@gmail.com>, relay=none, delay=0.18, delays=0.18/0/0/0, dsn=4.3.5, status=deferred (mail for mail.mydomain.com loops back to myself)
Reply With Quote
  #9  
Old 21st February 2009, 17:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

What's in /etc/postfix/local-host-names and /etc/postfix/main.cf?

Does this happen when you send a mail to a remote server or this server?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 21st February 2009, 20:11
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
 
Default

Hi Falko,

It happens when I send the email by thunderbird to an external email address.

in the /etc/postfix/local-host-names there are all the domain and subdomains, mail.mydomain.com included

Code:
[root@myserver ~]# 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 = /etc/postfix/local-host-names
myhostname = myserver.mydomain.com
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relayhost = mail.mydomain.com
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = 
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
This is the message on the maillog:
Feb 21 21:42:00 myserver postfix/smtp[23403]: D8C66C28008: to=<test@gmail.com>, relay=none, delay=0.2, delays=0.19/0.01/0/0, dsn=4.3.5, status=deferred (mail for mail.mydomain.com loops back to myself)

If I delete the config row: relayhost = mail.mydomain.com it works! But in the header inside the email received in the GMAIL service I can see this message:

Received-SPF: neutral (google.com: xxx.xxx.xxx.xxx is neither permitted nor denied by best guess record for domain of info@mydomain.com) client-ip= xxx.xxx.xxx.xxx;

Where xxx.xxx.xxx.xxx is my IP.

thanks

Last edited by vaio1; 21st February 2009 at 22:23.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relay access denied when using SMTP to external recipients Kamran Shah Installation/Configuration 111 14th May 2014 18:10
NOQUEUE: reject: Relay Access Denied & loops back to myself warlock Installation/Configuration 7 19th January 2009 14:06
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 13:06
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Questions in regards to ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" rbrantley HOWTO-Related Questions 16 10th April 2006 18:26


All times are GMT +2. The time now is 16:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.