简体   繁体   English

如何在AUTH PLAIN中使用用户名和密码?

[英]How to use user name and password in AUTH PLAIN?

I am trying to send Email using telnet and smtp.mail.yahoo.com server. 我正在尝试使用telnet和smtp.mail.yahoo.com服务器发送电子邮件。 when I try to authenticate myself on server using my yahoo mail ID and password. 当我尝试使用我的雅虎邮件ID和密码在服务器上验证自己。 the server gave me Error; 服务器给了我错误;

501 malformed auth input (#5.5.4)

I am using AUTH PLAIN mechanism. 我正在使用AUTH PLAIN机制。 I don't know how to combine user name and password. 我不知道如何组合用户名和密码。 And after that convert it to base64 and then send. 然后将其转换为base64然后发送。

Can somebody suggest me how to combine user name and password for AUTH PLAIN? 有人可以建议我如何组合AUTH PLAIN的用户名和密码? Thanks 谢谢

With AUTH PLAIN, the credentials should be sent according to this grammar (from RFC 4616 ): 使用AUTH PLAIN,应根据此语法(来自RFC 4616 )发送凭据:

message   = [authzid] UTF8NUL authcid UTF8NUL passwd
authcid   = 1*SAFE ; MUST accept up to 255 octets
authzid   = 1*SAFE ; MUST accept up to 255 octets
passwd    = 1*SAFE ; MUST accept up to 255 octets
UTF8NUL   = %x00 ; UTF-8 encoded NUL character
[...]

It seems common to have an empty authzid for SMTP servers, thus this should compute a working AUTH PLAIN message for you: 对SMTP服务器使用空的authzid似乎很常见,因此这应该为您计算一个有效的AUTH PLAIN消息:

echo -ne "\0username\0password"|base64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM