POP3命令详解

   服务器通过监听TCP端口110来启动POP3服务,当客户机与服务器连接后互相交换命令与响应。POP3的命令包括区分大小写的关键字,可能包括一个或多个参数。关键字与参数包括可打印的ASCII字符,之间由单个空格分开。关键字为三或四个字符长,每个参数最长为40个字符。
  POP3的响应最长512个字符,以CRLF结束。有肯定与否定两种状态,分别用+OK与+ERR来表示。某些命令的响应可能有多行,这时在最后一行用单个"."字符结束。
  一个POP3的对话在生存期经历几个状态,当连接刚建立POP3服务器发送了问候之后,对话进入了认证状态(AUTHORIZATION)。这时客户必须登录,成功完成后对话进入了事务状态(TRANSACTION)。当客户发出QUIT命令后,对话进入了更新状态(UPDATE),这时POP3服务器释放此连接所有的资源并且关闭连接。


  POP3命令概要:
    最小POP3命令集:

         USER name               在AUTHORIZATION状态下有效
         PASS string
         QUIT

         STAT                    在TRANSACTION状态下有效
         LIST [msg]
         RETR msg
         DELE msg
         NOOP
         RSET
         QUIT
    可选POP3命令:

         APOP name digest        在AUTHORIZATION状态下有效

         TOP msg n               在TRANSACTION状态下有效
         UIDL [msg]

      POP3响应:

         +OK
         -ERR

  POP3命令详解:
      USER name
         参数:
             一个标识信箱的字符串,仅对服务器有意义
         限制:
             只能用在AUTHORIZATION状态下,当得到POP3欢迎信息后或者
             在不成功的USER或者PASS命令后
         可能的响应:
             +OK name is a valid mailbox
             -ERR never heard of mailbox name
         Examples:
             C: USER frated
             S: -ERR sorry, no mailbox for frated here
                ...
             C: USER mrose
             S: +OK mrose is a real hoopy frood
      PASS string
         Arguments:
             a server/mailbox-specific password (required)
         Restrictions:
             may only be given in the AUTHORIZATION state immediately

             after a successful USER command
         Possible Responses:
             +OK maildrop locked and ready
             -ERR invalid password
             -ERR unable to lock maildrop
         Examples:
             C: USER mrose
             S: +OK mrose is a real hoopy frood
             C: PASS secret
             S: -ERR maildrop already locked
               ...
             C: USER mrose
             S: +OK mrose is a real hoopy frood
             C: PASS secret
             S: +OK mrose's maildrop has 2 messages (320 octets)
      QUIT
         Arguments: none
         Restrictions: none
         Possible Responses:
             +OK
         Examples:
             C: QUIT
             S: +OK dewey POP3 server signing off

      STAT
         Arguments: none
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK nn mm
         Examples:
             C: STAT
             S: +OK 2 320
      LIST [msg]
         Arguments:
             a message-number (optional), which, if present, may NOT
             refer to a message marked as deleted
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK scan listing follows
             -ERR no such message
         Examples:
             C: LIST
             S: +OK 2 messages (320 octets)
             S: 1 120
             S: 2 200
             S: .
               ...
             C: LIST 2
             S: +OK 2 200
               ...
             C: LIST 3
             S: -ERR no such message, only 2 messages in maildrop
      RETR msg
         Arguments:
             a message-number (required) which may NOT refer to a
             message marked as deleted
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK message follows
             -ERR no such message
         Examples:
             C: RETR 1
             S: +OK 120 octets
             S: <the POP3 server sends the entire message here>
             S: .
      DELE msg
         Arguments:
             a message-number (required) which may NOT refer to a
             message marked as deleted
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK message deleted
             -ERR no such message
         Examples:
             C: DELE 1
             S: +OK message 1 deleted
                ...
             C: DELE 2
             S: -ERR message 2 already deleted
      NOOP
         Arguments: none
         Restrictions:
             may only be given in the TRANSACTION state
         Discussion:
             The POP3 server does nothing, it merely replies with a
             positive response.
         Possible Responses:
             +OK
         Examples:
             C: NOOP
             S: +OK
      RSET
         Arguments: none
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK
         Examples:
             C: RSET
             S: +OK maildrop has 2 messages (320 octets)
      QUIT
         Arguments: none
         Restrictions: none
         Possible Responses:
             +OK
             -ERR some deleted messages not removed
         Examples:
             C: QUIT
             S: +OK dewey POP3 server signing off (maildrop empty)
                ...
             C: QUIT
             S: +OK dewey POP3 server signing off (2 messages left)
                ...

      TOP msg n
         Arguments:
             a message-number (required) which may NOT refer to to a
             message marked as deleted, and a non-negative number
             of lines (required)
         Restrictions:
             may only be given in the TRANSACTION state
         Possible Responses:
             +OK top of message follows
             -ERR no such message
         Examples:
             C: TOP 1 10
             S: +OK
             S: <the POP3 server sends the headers of the
                message, a blank line, and the first 10 lines
                of the body of the message>
             S: .
                ...
             C: TOP 100 3
             S: -ERR no such message
      UIDL [msg]
      Arguments:
          a message-number (optional), which, if present, may NOT
          refer to a message marked as deleted
      Restrictions:
          may only be given in the TRANSACTION state.
      Possible Responses:
          +OK unique-id listing follows
          -ERR no such message
      Examples:
          C: UIDL
          S: +OK
          S: 1 whqtswO00WBw418f9t5JxYwZ
          S: 2 QhdPYR:00WBw1Ph7x7
          S: .
             ...
          C: UIDL 2
          S: +OK 2 QhdPYR:00WBw1Ph7x7
             ...
          C: UIDL 3
          S: -ERR no such message, only 2 messages in maildrop
      APOP name digest
         Arguments:
             a string identifying a mailbox and a MD5 digest string
             (both required)
         Restrictions:
             may only be given in the AUTHORIZATION state after the PO
P3
             greeting or after an unsuccessful USER or PASS command
         Possible Responses:
             +OK maildrop locked and ready
             -ERR permission denied
         Examples:
             S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us
>
             C: APOP mrose c4c9334bac560ecc979e58001b3e22fb
             S: +OK maildrop has 1 message (369 octets)

  POP3对话举例:

      S: <wait for connection on TCP port 110>
      C: <open connection>
      S:    +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
      C:    APOP mrose c4c9334bac560ecc979e58001b3e22fb
      S:    +OK mrose's maildrop has 2 messages (320 octets)
      C:    STAT
      S:    +OK 2 320
      C:    LIST
      S:    +OK 2 messages (320 octets)
      S:    1 120
      S:    2 200
      S:    .
      C:    RETR 1
      S:    +OK 120 octets
      S:    <the POP3 server sends message 1>
      S:    .
      C:    DELE 1
      S:    +OK message 1 deleted
      C:    RETR 2
      S:    +OK 200 octets
      S:    <the POP3 server sends message 2>
      S:    .
      C:    DELE 2
      S:    +OK message 2 deleted
      C:    QUIT
      S:    +OK dewey POP3 server signing off (maildrop empty)
      C:  <close connection>
      S:  <wait for next connection>
大势至局域网文件共享管理系统可以详细审计局域网电脑访问服务器共享文件的行为,包括新建、拷贝、修改、删除、剪切、重命名等操作,从而便于对员工访问共享文件的行为进行全程的记录和查证,便于网管员进行事后审计和调查取证。同时,通过对共享文件进行保护设置,还可以防止局域网用户有意或不小心删除共享文件的情况。功能介绍:1、记录服务器共享文件夹或共享文件的访问情况,包括读取、拷贝、修改、删除、重命名、打印等情况,可以记录访问者采用的登录账户、IP地址、MAC地址、时间、访问时长、具体操作情况等。2、根据共享文件夹或共享文件来查询局域网电脑访问共享文件的具体操作情况。3、根据IP或MAC地址来查询局域网主机对那些共享文件做了那些具体操作。4、根据访问权限来显示对应的共享文件,没有访问权限的共享文件将予以隐藏。5、对重要共享文件进行实时备份功能,可以在一定条件下进行实时还原。6、对重要共享文件进行防删除操作,一旦蓄意或误操作删除共享文件可以恢复。7、通过账户、IP和MAC地址三重绑定来限定客户端的电脑访问共享文件情况,一旦不符合绑定规则,禁止其访问共享文件。8、限制外来电脑或未经授权的电脑访问共享文件,也即必须加入到许可访问共享文件的白名单电脑才可以访问共享文件。9、支持在公司外部或外地访问单位局域网共享文件服务器并提供监控功能。10、访问共享文件的日志情况可以导出为其他格式,如word、excel等,便于第三方审计。11、集成开放的功能扩展接口,可以与我公司的商用安全计算机、外来电脑控制系统相互配合,强化对共享文件的保护。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值