Solved

Relay Access Denied?

Posted on 2004-04-10
11
6,013 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now