RSS

利用telnet进行SMTP的验证

28 Dec

telnet [servername/ip] 25

HELO [localhost] // 与服务器打招呼,并告知客户端使用的机器名字,可以随便填写
250 serverfqdn helo

AUTH  LOGIN  //使用身份认证登陆指令
334 VXNlcm5hbWU6
bWljaGFlbA== //输入已经base64_encode过的用户名.(username: michael)(http://makcoder.sourceforge.net/demo/base64.php ,base编码工具,用系统用户进行验证)
334 UGFzc3dvcmQ6
MTIz  //输入已经base64_encode过的密码(password: 123)
235 Authentication successful
MAIL FROM: tom@station2.example.com //告诉服务器发信人的地址,万恶的空格
250 Mail OK
RCPT TO:george@station3.example.com //告诉服务器收信人的地址,万恶的空格
250 Mail OK
DATA  //正面开始传输信件的内容,且最后要以只含有 . 的特殊行结束。
354 End data with <CR><LF>.<CR><LF>
This is a test mail.
Thanks for your reading.
. //结束传输信件
250 Mail OK queued as ……….
QUIT  //断开连接
221 Bye
Connection closed by foreign host.

在bash shell下获得base64字符串编码
perl -e ‘use MIME::Base64;print encode_base64("text");’

状态码说明:
220 :服务就绪
250 :请求邮件动作正确,完成(HELO,MAIL FROM,RCPT TO,QUIT 指令执行成功会返回此信息)
235 :认证通过
221 :正在处理
354 :开始发送数据,结束以 .(DATA指令执行成功会返回此信息)
500 :语法错误,命令不能识别
550 :命令不能执行,邮箱无效
552 :中断处理:用户超出文件空间

Advertisements
 
Leave a comment

Posted by on December 28, 2008 in Exchange Server

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: