zl程序教程

您现在的位置是:首页 >  其他

当前栏目

pop3&&IMAP4 login详解程序员

程序员 详解 &# 038 login pop3
2023-06-13 09:20:03 时间
clean.sh 删除邮件
#!/bin/sh username="[email protected]"; password="password"; MAX_MESS=$1 [ $# -eq 0 ] exit 1 || : sleep 2 echo USER $username sleep 1 echo PASS $password sleep 2 for (( j = 1 ; j = $MAX_MESS; j++ )) echo DELE $j sleep 1 done echo QUIT

# Copyright 2004, Chris F.A. Johnson # Released under the terms of the GNU General Public License CR=$/r ## carriage return; for removal of ## connect to POP3 server on local machine, port 110 exec 3 /dev/tcp/127.0.0.1/110 ## get response from server read ok line 3 ## check that it succeeded [ "${ok%$CR}" != "+OK" ] exit 5 ## send user name, get response and check that it succeeded echo user poppy 3 read ok line 3 [ "${ok%$CR}" != "+OK" ] exit 5 ## send password, get response and check that it succeeded echo pass pop3test 3 read ok line 3 [ "${ok%$CR}" != "+OK" ] exit 5 ## get number of messages echo stat 3 read ok num x 3 ## display number of messages echo $num messages ## close connection echo quit 3

 

[[email protected] ~] nc imap.mailserver.com 143 

* OK [CAPABILITY IMAP4 IMAP4rev1 IDLE PUSHSERVICE ID UIDPLUS AUTH=LOGIN NAMESPACE] Mail IMAP4Server ready 

C1 LOGIN [email protected] password 

C1 OK Success login ok

 

 

2474.html

服务器部署程序员系统优化网站设置运维