telnet imap&pop

转自: http://hi.baidu.com/rev_k_fycd/blog/item/969d6b4b6c1c9f3508f7eff4.html

telnet imap&pop
2011-04-29 15:57

telnet pop很简单。在知道pop服务器路径后(例如126邮箱),打开终端,输入:

$ telnet pop.126.com 110

回车后进入pop的认证状态,输入命令

user name@domin

用户名正确返回:

+OK core mail

输入命令:

pass password

用户名正确返回:

+OK XXX message(s) [XXX byte(s)]

之后使用pop的命令来查阅邮件了。

 

telnet imap稍微麻烦些,我是在ubuntu上,需要stunnel提供全局的TLS/SSL 服务。

具体方法,首先安装stunnel:

$ sudo apt-get install stunnel

之后修改stunnel配置文件:/etc/default/stunnel4,将其中ENABLED=0改为ENABLED=1

修改/etc/stunnel/stunnel.conf文件如下

;====================================================================

; Sample stunnel configuration file by Michal Trojnara 2002-2006
; Some options used here may not be adequate for your particular configuration
; Please make sure you understand them (especially the effect of chroot jail)

; Certificate/key is needed in server mode and optional in client mode
;cert = /etc/stunnel/mail.pem
;key = /etc/stunnel/mail.pem

; Protocol version (all, SSLv2, SSLv3, TLSv1)
sslVersion = SSLv3

; Some security enhancements for UNIX systems - comment them out on Win32
chroot = /var/lib/stunnel4/
setuid = stunnel4
setgid = stunnel4
; PID is created inside chroot jail
pid = /stunnel4.pid

; Some performance tunings
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
;compression = rle

; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS

; Authentication stuff
;verify = 2
; Don't forget to c_rehash CApath
; CApath is located inside chroot jail
;CApath = /certs
; It's often easier to use CAfile
;CAfile = /etc/stunnel/certs.pem
; Don't forget to c_rehash CRLpath
; CRLpath is located inside chroot jail
;CRLpath = /crls
; Alternatively you can use CRLfile
;CRLfile = /etc/stunnel/crls.pem

; Some debugging stuff useful for troubleshooting
debug = 7
output = /var/log/stunnel4/stunnel.log

; Use it for client mode
client = yes

; Service-level configuration

;[pop3s]
;accept = 995
;connect = 110

[imaps]
accept = 143
connect = imap.gmail.com:993

;[ssmtp]
;accept = 465
;connect = 25

;[https]
;accept = 443
;connect = 80
;TIMEOUTclose = 0

; vim:ft=dosini

;======================================================================

这样修改后,将只能telnet gmail了,要telnet别的,请修改[imaps]下的值。

之后启动stunnel

$ sudo /etc/init.d/stunnel4 start

开启telnet:

telnet localhost 143

进入imap的认证状态(可能不叫认证状态,总之现在要用用户名密码登录邮箱了)

输入命令:

Tag name@domin password

其中,Tag是随意的值,但必须要有,具体为什么正在学习中,后面是完整的用户名,密码。

验证正确己登录邮箱了。

mark一下,下次得把pop和imap的命令贴上。好在pop的命令不多。。

telnet的imap部分翻译自http://wiredbytes.com/node/8,要翻墙,谢谢。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值