zoukankan      html  css  js  c++  java
  • 相对完美解决Lumisoft POP3 重复 接收 邮件问题

    问题的关键是Mail_Message的UID在当前会话中唯一且不变,在多次会话中唯一但会变化

    所以无法从本地验证服务器端的某封邮件是否已接收过

    那使用最后收取时间似乎可以解决问题,但这带来的另一个问题是,Messages需要按Date排序,如果无序则需先排序,并且Date可能重复,几率还是不小

    最后解决方法是使用MD5加密(邮箱帐户(abc@abc.com) + 邮件标题+邮件接收时间)后的结果作为唯一不变标识

    原理就是邮箱帐户不会变,邮件标题不会变,服务器端的邮件接收时间不会变,加密过程不会变,那结果也不会变,说白了就是一个"联合主键"的道理~



    static MD5CryptoServiceProvider md5;
            public static string MD5String(string ConvertString) {
                if (null == md5) md5 = new MD5CryptoServiceProvider();
                string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)));
                Log.Information(t2);
                return t2.Replace("-", "");
            }
    


    官方相关示例下载http://www.lumisoft.ee/lswww/download/downloads/Examples/

    后补,UID是全局唯一的,我上边说错了!多次会话也是唯一的,希望我没有误导到别人,真惭愧!!

    把UID这块描述拿出来了~有雅兴的客观可以瞧瞧
    http://www.ietf.org/rfc/rfc1939.txt 

    The unique-id of a message is an arbitrary server-determined
              string, consisting of one to 70 characters in the range 0x21
              to 0x7E, which uniquely identifies a message within a
              maildrop and which persists across sessions.  This
              persistence is required even if a session ends without
              entering the UPDATE state.  The server should never reuse an
              unique-id in a given maildrop, for as long as the entity
              using the unique-id exists.
    
  • 相关阅读:
    linux下配置php的一些信息
    前端学习
    Verilog笔记.3.有限状态机
    Verilog笔记.2.数字逻辑电路
    Verilog笔记.1.基本语法
    python3爬虫.4.下载煎蛋网妹子图
    python3爬虫.3.下载网页图片
    python3爬虫.2.伪装浏览器
    python3爬虫.1.简单的网页爬虫
    python3学习笔记.3.条件控制与循环
  • 原文地址:https://www.cnblogs.com/kkun/p/1671117.html
Copyright © 2011-2022 走看看