/// <summary> /// Send GETQUOTAROOT command to IMAP server. /// <param name="folderName"></param> /// </summary> /// <returns></returns> public ImapCommandResult ExecuteGetQuotaRoot(String folderName) { String s = this.Execute(this.Tag + " GETQUOTAROOT " + folderName); String commandText = String.Format(this.Tag + " GETQUOTAROOT {0}", NamingConversion.EncodeString(folderName)); return(new ImapCommandResult(this.Tag, s)); }
/// <summary> /// Send delete folder command to IMAP server. /// </summary> /// <returns></returns> public ImapCommandResult ExecuteDelete(String folderName) { this.ValidateState(ImapConnectionState.Authenticated); String commandText = String.Format(this.Tag + " Delete {0}", NamingConversion.EncodeString(folderName)); String s = this.Execute(commandText); return(new ImapCommandResult(this.Tag, s)); }
/// <summary> /// Send examine command to IMAP server. /// </summary> /// <returns></returns> public SelectResult ExecuteExamine(String folderName) { this.ValidateState(ImapConnectionState.Authenticated); String commandText = String.Format(this.Tag + " Examine {0}", NamingConversion.EncodeString(folderName)); String s = this.Execute(commandText); var rs = this.GetSelectResult(folderName, s); this.CurrentFolder = new ImapFolder(rs); return(rs); }
/// <summary> /// Send rename folder command to IMAP server. /// </summary> /// <returns></returns> public ImapCommandResult ExecuteRename(String oldFolderName, String folderName) { this.ValidateState(ImapConnectionState.Authenticated); String commandText = String.Format(this.Tag + " Rename {0} {1}", NamingConversion.EncodeString(oldFolderName), NamingConversion.EncodeString(folderName)); String s = this.Execute(commandText); var rs = new ImapCommandResult(this.Tag, s); if (rs.Status == ImapCommandResultStatus.Ok || rs.Status == ImapCommandResultStatus.None) { return(rs); } return(rs); }
/// <summary> /// /// </summary> /// <param name="folderName"></param> /// <param name="mailData"></param> /// <param name="flag"></param> /// <param name="datetime"></param> /// <returns></returns> public ImapCommandResult ExecuteAppend(String folderName, String mailData, String flag, DateTimeOffset datetime) { String commandText = String.Format(this.Tag + " APPEND \"{0}\" ({1}) \"{2}\" " , NamingConversion.EncodeString(folderName), flag, MailParser.DateTimeOffsetString(datetime)); commandText += "{" + mailData.Length + "}"; String s = this.Execute(commandText); var rs = new ImapCommandResult(this.Tag, s); if (rs.Status == ImapCommandResultStatus.Ok || rs.Status == ImapCommandResultStatus.None) { var ss = this.Execute(mailData); return(new ImapCommandResult(this.Tag, ss)); } return(rs); }