多语言展示
当前在线:453今日阅读:195今日分享:14

命令行邮件测试方法

通过命令行检测mail服务器
工具/原料

Linux  perl

方法/步骤
1

Base64 编码的生成# perl -MMIME::Base64 -e 'print encode_base64('root\@test.net');'cm9vdEB0ZXN0Lm5ldA==# perl -MMIME::Base64 -e 'print encode_base64('000000');'MDAwMDAw

2

测试发送邮件(端口:25):mail# telnet 127.0.0.1 25Trying 127.0.0.1...Connected to 0.Escape character is '^]'.220 mail.test.net ESMTP Postfixehlo mail250-mail.test.net250-PIPELINING250-SIZE 4194304250-VRFY250-ETRN250-AUTH NTLM LOGIN PLAIN OTP250-AUTH=NTLM LOGIN PLAIN OTP250 8BITMIMEauth login334 VXNlcm5hbWU6cm9vdEB0ZXN0Lm5ldA== //用户名id:root@test.net334 UGFzc3dvcmQ6MDAwMDAw //用户密码password: Authentication successfulMAIL FROM: //告诉服务器发件人的Email地址250 OkRCPT TO: //告诉服务器收件人的地址250 OKDATA //告诉服务器开始写信354 End data with .SUBJECT:test //subject后面填写的是邮件的主题test. //换行后输入.后按回车,表示信件内容书写完毕250 Ok: queued as 58DC71D5quit //发送信件,结束对话,退出SMTP服务器221 ByeConnection closed by foreign host

3

测试收取邮件(端口:110):mail# telnet 127.0.0.1 110Trying 127.0.0.1...Connected to 0Escape character is '^]'+OK Hello thereuser root@test.net+OK Password requiredpass 000000+OK logged inlist+OK POP3 clients that break here, they violate STD531 2217retr 1 //返回第一封信的全部内容+OK 2217 octets follow.Return-Path: X-Original-To: root@test.netDelivered-To: root@test.netReceived: from mail (localhost.test.net [127.0.0.1])by mail.test.net (Postfix) with ESMTP id 58DC71D5for ; Mon, 9 Aug 2013 21:11:20 +0800 (CST)SUBJECT:testMessage-Id: <200.58DC71D5@mail.test.net>Date: Mon, 9 Aug 2013 21:11:20 +0800 (CST)From: root@test.netTo: undisclosed-recipients:;test.dele 1 //删除+OK Deletedquit+OK Bye-byeConnection closed by foreign host

推荐信息