Solved

Relay Access Denied?

Posted on 2004-04-10
11
6,010 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

707 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

17 Experts available now in Live!

Get 1:1 Help Now