220 mx1.hudong.com ESMTP Postfix
EHLO localhost
250-mx1.hudong.com
250-PIPELINING
250-SIZE 204800000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN sldfkZedEwxddLSXVFDssW=
235 2.0.0 Authentication successful
MAIL FROM:
250 2.1.0 Ok
RCPT TO:
250 2.1.5 Ok
DATA
354 End data with
mail test.
.
250 2.0.0 Ok: queued as E78388824003
QUIT
221 2.0.0 Bye
Connection closed by foreign host.
AUTH PLAIN 后面接用户ID和密码的base64编码,可用如下命令产生
$ printf 'kdent\0kdent\0Rumpelstiltskin' | mmencode
a2RlbnQAa2RlbnQAcnVtcGxlc3RpbHRza2lu
其中用户名是kdent,密码是Rumpelstiltskin
也可用如下perl脚本生成
#!/usr/bin/perl
use strict;
use MIME::Base64;
if ( $#ARGV != 1 ) {
die "Usage: encode_sasl_plain.pl
}
print encode_base64("$ARGV[0]\0$ARGV[0]\0$ARGV[1]");
exit 0;
DATA表示要发送邮件消息,邮件消息以 回车换行加点再回车换行 结尾。
没有评论:
发表评论