• 相对完美解决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.
    
  • 相关阅读:
    NOI2019 I 君的商店
    CF1326F
    APIO2016 划艇
    LeetCode-Remove Nth Node From End of List
    LeetCode-Remove Element
    LeetCode-Remove Duplicates from Sorted List II
    LeetCode-Remove Duplicates from Sorted List
    LeetCode-Unique Paths II
    LeetCode-Unique Paths
    LeetCode-Remove Duplicates from Sorted Array II
  • 原文地址:https://www.cnblogs.com/kkun/p/1671117.html
Copyright © 2020-2023  润新知