調試一個curl請求/什麼是curl請求來測試給定的用戶名/密碼是否適用於特定的smtp伺服器

調試一個curl請求/什麼是curl請求來測試給定的用戶名/密碼是否適用於特定的smtp伺服器

我有一位客戶使用特定的應用程序,該應用程式使用安全 smtp 來連接外發電子郵件。我懷疑它以某種方式被改變了(無論是他們還是託管提供者都無關緊要)。我想透過curl 驗證他們的傳出伺服器身份驗證是否正確。我沒有必要創建這個系統。我試過這個:

at Apr 18$ curl smtps://outbound.att.net:465 -v --mail-from "[email protected]" --mail-rcpt "[email protected]" --ssl -u [email protected]:ourpassword

但收到這個神秘的錯誤訊息:

* Rebuilt URL to: smtps://outbound.att.net:465/
* Hostname was NOT found in DNS cache
*   Trying 67.195.15.5...
* Connected to outbound.att.net (67.195.15.5) port 465 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: smtp.mail.att.net
* Server certificate: Symantec Class 3 Secure Server CA - G4
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
< 220 smtp.mail.att.net ESMTP ready
> EHLO jonathans-MacBook-Air
< 250-smtp.mail.att.net
< 250-PIPELINING
< 250-SIZE 41697280
< 250-8 BITMIME
< 250 AUTH PLAIN LOGIN XOAUTH2 XYMCOOKIE
> AUTH LOGIN
< 334 VXNlcm5hbWU6
> dGhlbmV3YW9jQGF0dC5uZXQ=
< 334 UGFzc3dvcmQ6
> SWxvdmVjaGVlc2UwOQ==
< 535 5.7.0 (#MBR1212) Incorrect username or password.
* Authentication failed: 535
* Closing connection 0
curl: (67) Authentication failed: 535

感謝您的幫助。

答案1

簡短回答:

驗證方法錯誤

更長的答案:

線索就是那句話Authentication failed: 535。雖然這可能意味著用戶名/密碼錯誤,但情況並非一定如此。這基本上意味著用於加密/散列用戶名和密碼的方法生成的字串與郵件伺服器記錄中的字串不符。如果使用者名稱和密碼正確,則最常見的原因是未考慮 SSL/TLS 或類似架構的使用。

筆記:

由於某種原因,如果帳戶因某種原因被暫停,則會使用相同的錯誤訊息。我覺得很奇怪,他們沒有為「帳戶未啟動」或類似的內容提供不同的錯誤代碼。為了確定起見,您可能需要先檢查帳戶的狀態。

相關內容