0

What is the algorithm for creating a login and password for AUTH on SMTP (port 587) or how can I create my login and password for AUTH from my own mail application, to connect to GMAIL for example?

Cribe
  • 1
  • 1
  • 4

2 Answers2

0
echo -ne '\0000username\0000password' | openssl base64

See this article of mine.

Kaspar Etter
  • 3,155
  • 1
  • 14
  • 21
  • i see, but i meant do i create myself my passowd and login, or i'm using the service's credentials (like my user@gmail.com, mygmailpassword) – Cribe Aug 05 '22 at 17:50
  • Email submission is almost always authenticated with user credentials for over two decades now; so yes, you need a user account at the [mailbox provider](https://en.wikipedia.org/wiki/Mailbox_provider). Only email relay takes place without usernames and passwords – but potentially with other authentication mechanisms such as SPF and DKIM as explained by Robert in reply to his answer. If you want to send more than a couple of emails a day, you should use a [email service provider](https://en.wikipedia.org/wiki/Email_service_provider_(marketing)) instead. – Kaspar Etter Aug 06 '22 at 08:52
0

You need to check what authentication mechanisms the server supports. The server will advertise them as part of the EHLO reply; see Wikipedia or RFC 4954. From the authentication mechanisms offered, you pick one. For example, if you are already using an encrypted connection, you can use PLAIN AUTH, or if the connection is not encrypted, you may need to use CRAMMD5.

Normally any SMTP client library should handle this for you.

GMail has changed their settings to lock out insecure apps around May / June 2022. If your question is about that, see this question's answers as well.

Robert
  • 7,394
  • 40
  • 45
  • 64
  • Do i understand it right: AUTH means that i need to have a gmail account, and with the help of AUTH LOGIN i'm just logging into my gmail account ? – Cribe Aug 05 '22 at 17:48
  • 1
    Yes. When you want to send through e.g., gmail, you need to be logged in to gmail. If you want to deliver to another server, you don't have a login with that server. For example, you@gmail.com wants to send to me@yahoo.com. The yahoo email server cannot verify that you are you@gmail.com, but it will check that the IP address you are coming from is allowed to send emails for gmail.com. That means you usually log in to gmail.com, gmail authenticates you, accepts your email, and delivers it to yahoo.com. – Robert Aug 05 '22 at 18:32