What is the need of SMTP AUTH?

有些话、适合烂在心里 提交于 2020-01-24 12:52:12

问题


I want to write an application which can receive emails locally and can response with successful and error responses.

After reading some tutorials about how SMTP works I was trying to send an email using telnet to my locally running SMTP server.

  1. Connect to SMTP server
  2. HELO/EHLO command
  3. AUTH ...
  4. MAIL from command
  5. RCPT to command
  6. DATA command
  7. write somedata
  8. QUITE

What I couldn't understand is step 3. Why do I need to be authenticated to send an email to localhost. I mean if I am yahoo user and I have to send an email to gmail user, how can I be authenticated to gmail SMTP server?


回答1:


SMTP Auth is used to authenticate the send email. SMTP AUTH authenticates you directly with our SMTP server. This is transparent to you as a user.

SMTP is the protocol (the language) your email program uses to send email through our email server. AUTH is the part of that protocol that is used to verify that you are one of our users.

SMTP authentication allows the client to show the server that this client has permission to relay e-mail through this server.

In most cases, you can send without authentication to local e-mail addresses of this domain

(i.e. send from bob@domain.com to alice@domain.com)

because the server does not need to relay your e-mail to external servers. Authentication is required whenever the recipient is not of a local domain

(i.e. send from joe@company.com to tom@example.com, provided that company.com and example.com use different e-mail servers).

If you want to read more about this Here I find the some reference where it explain very clearly.

  1. http://www.afterlogic.com/mailbee-net/docs/smtp_authentication.html
  2. http://www.softhome.net/help/faq/smtp-auth.html

Hope this can help full for you.




回答2:


SMTP AUTH protects the server from unauthorized use. For example, Google doesn't allow people to send email from Google's email servers unless they have an account. You prove that you have an account (or that you are somehow authorized to use their servers) by authenticating with the AUTH command.

Maybe an example where the email service isn't free would be more clear. If you are trying to send email using GoDaddy's email servers, but you don't have an account, they will prevent you from doing it. GoDaddy charges people to use their services.

If you are running a company called mycompany.com, and you run your own mail servers, you don't want every spammer in the world using your servers to send email out of your company. You require senders to authenticate using AUTH in order to protect your servers from unauthorized use.



来源:https://stackoverflow.com/questions/37205913/what-is-the-need-of-smtp-auth

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!