Solved

Relay Access Denied?

Posted on 2004-04-10
11
6,016 Views
Last Modified: 2013-11-13
Hi experts,

i have created a program that will send emails, i followed the protocol for smtp, but when i get to the part of sending the RCPT TO: <email address>, i get a reply of "relay access denied". does anyone know what that means?  i don't know if i should match the smtp server address to the receipt address. i mean if i'm sending to a mail.com account then i should be using the smtp server for mail.com. or could i use just any smtp server. is there a way to obtain the smtp server address for a certain email address by just looking at the domain part?

thanks very much
neostre
0
Comment
Question by:neostre
  • 3
  • 2
  • 2
  • +1
11 Comments
 

Expert Comment

by:PhilipStears
ID: 10797810
Neostre

Many SMTP servers; in an effort to reduce spam and other abuses of the facilities; will prevent mail being sent from them to other domains unless you authenticate with the server first.

In order to send the message correctly, just authenticate with the server first, or choose a server that does not require authentication.

Hope this helps,

Phil
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10799426
I think your relay problem is because you are sending to an email address that your smtp server does not consider local.  An example, your server hosts email addresses of itolm.com, you would not be able to use it to send email to microsoft.com,

make sure the email address your sending to is local to that smtp server, if your trying to send to an external email address, you will need to configure your mail server to allow you to do this (with either domain based exceptions, ip based relay exceptions, email forwarding accounts to name a few)
0
 
LVL 5

Expert Comment

by:danielsonchris
ID: 10801518
Here is an idea to help you fix this.  After coding many a smtp client out.  Most SMTP servers will allow you to relay if you at least authenticate with them using a simple Base64 algorithm.   Though if not, you may need to apply a cram-md5 or NTLM based on the mail server settings.

In order to try a basic base64 algo test try the following in your code.
after send the EHLO or HELO send an
"AUTH LOGIN\r\n".
After doing that
send the
"smtp_User_Name\r\n"

Then send the

"Base64Encoded_Password\r\n"

then move to your standard "MAIL From: ...."  call.
If you need anymore specifics please tell me the language you are using in order to supply you with some code examples.
-Chris
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:neostre
ID: 10801558
thanks for the info guys, i've been researching on this part, and i think ill go with the authentication part. although i still haven't tried it out yet. now my question would be what user name/password will i use? does that mean if i have a yahoo mail account, and i will send using that email address to an account in hotmail, i would need to use yahoo's smtp server and my username/password for me to be able to authenticate?
i am coding it using c++ language via the winsock api and not the mfc socket class.

any example would be highly appreciated, thanks in advance.

neostre
0
 
LVL 5

Accepted Solution

by:
danielsonchris earned 25 total points
ID: 10803167
Now, I'm not sure how Yahoo handles it's emails and if you can get direct access to it's smtp services.  Is that the server you are having to test off of?  All my tests with hand rolling SMTP have been with a specific smtp server such as "sendmail" and "microsoft exchange".  So this "relay access denied" error is coming from a Yahoo server?  If so, then try the base64 technique.  Assuming you have already found the "relay access denied" using the above listed protocol will take you mere minutes to implement.
The only code you may need is a base64 encoder... let me know.. I'll track my old lib down.. or I'm sure you can find one easily using google.  ;)  
Regards,
   Chris
0
 

Author Comment

by:neostre
ID: 10807004
yahoo is just my example here, but i did tried it for yahoo once and it didn't work. i tried some other smtp server that i know of, i even tried my isp's smtp and it didn't also work . someone told me that i might try using "open smtp servers" which they say will probably allow my mail to go thru without any authentication. i'm still searching if it is possible or there is such a server. if anyone knows any let me know, i would like to try it out.

thanks,
neostre
0
 
LVL 10

Assisted Solution

by:Kavar
Kavar earned 25 total points
ID: 10807193
if you specify your ISP, and you login, it will work fine
0
 
LVL 5

Expert Comment

by:danielsonchris
ID: 11044127
Wasn't authentication the solution?  I explained that clearly above and everything was left with:

"thanks for the info guys, i've been researching on this part, and i think ill go with the authentication part. although i still haven't tried it out yet. now my question would be what user name/password will i use? does that mean if i have a yahoo mail account, and i will send using that email address to an account in hotmail, i would need to use yahoo's smtp server and my username/password for me to be able to authenticate?
i am coding it using c++ language via the winsock api and not the mfc socket class.

any example would be highly appreciated, thanks in advance."


The points should be split up amongst those who helped.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question