Esempio n. 1
0
        } // ResetMessages

        public string DeleteMimeFiles()
        {
            string DeleteMimeFilesRet = default;
            // Delete all the MIME files marked for deletion in array blnDeleteFlags.
            // Only called after QUIT received in the Transaction state...

            int intIndex;

            if (intNumberOfMimeFiles == 0)
            {
                DeleteMimeFilesRet = "+OK" + Globals.CRLF;
                return(DeleteMimeFilesRet);
            }

            if (intNumberOfMimeFiles > 0)
            {
                var messageStore = new MessageStore(DatabaseFactory.Get());
                var emails       = messageStore.GetAccountEmails(strAccountName);
                var loopTo       = intNumberOfMimeFiles;
                for (intIndex = 1; intIndex <= loopTo; intIndex++)
                {
                    if (blnDeleteFlags[intIndex - 1] == true)
                    {
                        messageStore.DeleteAccountEmail(strAccountName, emails[intIndex - 1].Key);
                    }
                }
            }

            DeleteMimeFilesRet = "+OK" + Globals.CRLF;
            return(DeleteMimeFilesRet);
        } // DeleteMimeFiles