Esempio n. 1
0
        /// <summary>
        /// FETCH
        /// </summary>
        public static List <ImapResponse> GenerateBySeqId(MailDb mailDb, SelectFolder Folder, string Cmd)
        {
            var cmdReader = new CommandReader(Cmd);
            var set       = cmdReader.SequenceSet;
            var range     = GetSequenceRange(set);

            var AllDataItems = cmdReader.ReadAllDataItems();

            var messages = ImapHelper.GetMessagesBySeqNo(mailDb, Folder, range);

            return(Generate(mailDb, Folder, AllDataItems, messages));
        }
Esempio n. 2
0
        /// <summary>
        /// UID FETCH
        /// </summary>
        public static List <ImapResponse> GenerateByUid(MailDb mailDb, SelectFolder Folder, string Cmd)
        {
            var cmdReader = new CommandReader(Cmd);
            var set       = cmdReader.SequenceSet;
            var range     = GetSequenceRange(set);

            var AllDataItems = cmdReader.ReadAllDataItems();

            var messages = ImapHelper.GetMessagesByUid(mailDb, Folder, range);

            // Auto include UID data item
            if (!AllDataItems.Any(o => o.Name == "UID"))
            {
                AllDataItems.Insert(0, new DataItem
                {
                    Name         = "UID",
                    FullItemName = "UID"
                });
            }

            return(Generate(mailDb, Folder, AllDataItems, messages));
        }