protected async Task EndWithResultAsync(
            IImapMessageChannel channel,
            CommandResult result,
            TagMessageData tags,
            string text,
            CancellationToken cancellationToken)
        {
            if (result == CommandResult.Ok && text == null)
            {
                text = CommandName + " completed";
            }

            if (tags == null)
            {
                await channel.CommandCompletedAsync(GetResultMessage(result, new ServerMessageData(text)), this, cancellationToken);
            }
            else
            {
                await
                channel.CommandCompletedAsync(
                    GetResultMessage(result, tags, new ServerMessageData(text)),
                    this,
                    cancellationToken);
            }
        }
 public CreateCommandFactory(
     IImapMessageChannel channel,
     IImapMailStore mailstore)
 {
     _channel   = channel;
     _mailstore = mailstore;
 }
Exemple #3
0
 public RenameCommand(
     IImapMessageChannel channel,
     IImapMailStore mailstore)
 {
     _channel   = channel;
     _mailstore = mailstore;
 }
 public static Task SendMessageAsync(
     this IImapMessageChannel channel,
     ImapMessage message,
     CancellationToken cancellationToken)
 {
     return(channel.SendMessageAsync(message, DefaultEncoding, cancellationToken));
 }
Exemple #5
0
 public AuthenticateCommand(
     IIndex <string, Lazy <IAuthenticationSession, AuthencticationMechanismMetadata> > auth,
     IImapMessageChannel channel)
 {
     _auth    = auth;
     _channel = channel;
 }
 protected Task EndWithResultAsync(
     IImapMessageChannel channel,
     CommandResult result,
     string text,
     CancellationToken cancellationToken)
 {
     return(EndWithResultAsync(channel, result, null, text, cancellationToken));
 }
 public CapabilityCommand(
     IConnectionSecurity connection,
     IEnumerable <Lazy <IAuthenticationSession, AuthencticationMechanismMetadata> > auth,
     IImapMessageChannel channel)
 {
     _connection = connection;
     _auth       = auth;
     _channel    = channel;
 }
 protected ExamineOrSelectCommand(
     IImapMailStore mailstore,
     IImapMessageChannel channel,
     IImapMailboxPointer mailboxPointer)
 {
     _mailstore      = mailstore;
     _channel        = channel;
     _mailboxPointer = mailboxPointer;
 }
        public static Task ReportBadAsync(
            IImapMessageChannel imapSession,
            string tag,
            string errorText,
            CancellationToken cancellationToken)
        {
            var message = new ImapMessage(tag, "BAD", new List <IMessageData> {
                new ServerMessageData(errorText)
            });

            return(imapSession.SendMessageAsync(message, DefaultEncoding, cancellationToken));
        }
Exemple #10
0
 public StartTlsCommand(SecurableConnection connection, IImapMessageChannel channel)
 {
     _connection = connection;
     _channel    = channel;
 }
Exemple #11
0
 public ExamineCommand(IImapMailStore mailstore, IImapMessageChannel channel, IImapMailboxPointer mailboxPointer) :
     base(mailstore, channel, mailboxPointer)
 {
 }
Exemple #12
0
 public NoopCommand(IImapMessageChannel channel)
 {
     _channel = channel;
 }
Exemple #13
0
 public SearchCommand(IImapMessageChannel channel)
 {
     _channel = channel;
 }
Exemple #14
0
 public StoreCommand(IImapMailStore mailstore, IImapMessageChannel channel, IImapMailboxPointer mailboxPointer)
 {
     _mailstore      = mailstore;
     _channel        = channel;
     _mailboxPointer = mailboxPointer;
 }
Exemple #15
0
 public LSubCommand(IImapMessageChannel channel, IImapMailStore mailstore) : base(channel, mailstore)
 {
 }
Exemple #16
0
 public CheckCommand(IImapMessageChannel channel)
 {
     _channel = channel;
 }
Exemple #17
0
 public LoginCommand(IImapMessageChannel channel, IUserStore userstore)
 {
     _channel   = channel;
     _userstore = userstore;
 }
Exemple #18
0
 protected SubscribeOrUnsubscribeCommand(IImapMessageChannel channel, IImapMailStore mailstore)
 {
     _channel   = channel;
     _mailstore = mailstore;
 }
Exemple #19
0
 public LogoutCommand(IImapMessageChannel channel)
 {
     _channel = channel;
 }
Exemple #20
0
 protected ListOrLSubCommand(IImapMessageChannel channel, IImapMailStore mailstore)
 {
     _channel   = channel;
     _mailstore = mailstore;
 }
Exemple #21
0
 public ExpungeCommand(IImapMessageChannel channel, IImapMailboxPointer mailboxPointer)
 {
     _channel        = channel;
     _mailboxPointer = mailboxPointer;
 }
Exemple #22
0
 public DeleteCommand(IImapMailStore mailstore, IImapMessageChannel channel)
 {
     _mailstore = mailstore;
     _channel   = channel;
 }
Exemple #23
0
 protected Task EndOkAsync(IImapMessageChannel channel, string message, CancellationToken cancellationToken)
 {
     return(EndWithResultAsync(channel, CommandResult.Ok, message, cancellationToken));
 }
Exemple #24
0
 public UnsubscribeCommand(IImapMessageChannel channel, IImapMailStore mailstore) : base(channel, mailstore)
 {
 }