Update of /cvsroot/csmaild/csmaild/src/Imap/Commands
In directory sc8-pr-cvs1:/tmp/cvs-serv22151/src/Imap/Commands
Modified Files:
CreateCommand.cs DeleteCommand.cs FetchCommand.cs
Log Message:
Added MessageCollection to store the collection of messages in a mailbox
DELETE should work now, had to modify the mail store to support deleting of messages and mailboxes
Index: CreateCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/CreateCommand.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CreateCommand.cs 27 Jul 2003 19:33:00 -0000 1.5
--- CreateCommand.cs 28 Jul 2003 00:15:17 -0000 1.6
***************
*** 39,42 ****
--- 39,43 ----
soFar += (idx == 0 ? string.Empty : "/") + parts[idx];
if(idx == parts.Length-1)
+
boxes.Add(soFar);
else
Index: DeleteCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/DeleteCommand.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DeleteCommand.cs 26 Jul 2003 23:09:25 -0000 1.4
--- DeleteCommand.cs 28 Jul 2003 00:15:17 -0000 1.5
***************
*** 1,2 ****
--- 1,4 ----
+ using Common;
+
using System;
***************
*** 8,12 ****
public class DeleteCommand : ImapCommand
{
! public DeleteCommand(ImapServer svr) : base(svr, "DELETE", ImapCommand.AuthSelectedState)
{
}
--- 10,14 ----
public class DeleteCommand : ImapCommand
{
! public DeleteCommand(ImapServer svr) : base(svr, "DELETE", ImapCommand.AuthSelectedState, ArgumentType.AString)
{
}
***************
*** 14,18 ****
override protected bool InternalProcess()
{
! return false;
}
}
--- 16,59 ----
override protected bool InternalProcess()
{
! string mbxName = mParsedArguments[0] as string;
!
! if(mbxName.ToUpper() == "INBOX")
! {
! mConnection.SendTaggedMessage("NO Cannot delete INBOX");
! return true;
! }
!
! Mailbox box = mConnection.User.Mailboxes[mbxName];
!
! if(box == null)
! {
! mConnection.SendTaggedMessage("NO Does not exist");
! return true;
! }
! /*
! It is permitted to delete a name that has inferior hierarchical
! names and does not have the \Noselect mailbox name attribute. In
! this case, all messages in that mailbox are removed, and the name
! will acquire the \Noselect mailbox name attribute.
!
! The value of the highest-used unique identifier of the deleted
! mailbox MUST be preserved so that a new mailbox created with the
! same name will not reuse the identifiers of the former
! incarnation, UNLESS the new incarnation has a different unique
! identifier validity value. See the description of the UID command
! for more detail.
! */
!
! if(box.HasChildren && box.NoSelect)
! {
! mConnection.SendTaggedMessage("NO Cannot delete");
! return true;
! }
!
! box.Messages.Clear();
! box.Delete();
!
! mConnection.SendTaggedMessage("OK Deleted");
! return true;
}
}
Index: FetchCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/FetchCommand.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FetchCommand.cs 26 Jul 2003 23:55:47 -0000 1.5
--- FetchCommand.cs 28 Jul 2003 00:15:17 -0000 1.6
***************
*** 37,41 ****
}
else
! mConnection.SendTaggedMessage("BAD");
// done
--- 37,41 ----
}
else
! mConnection.SendTaggedMessage("BAD Invalid request list");
// done
***************
*** 246,250 ****
}
- // ["<" number "." nz-number ">"]
if(idx < section.Length)
{
--- 246,249 ----
|