Ejemplo n.º 1
0
 // Token: 0x06000127 RID: 295 RVA: 0x00006A38 File Offset: 0x00004C38
 internal ImapNetworkFacade(ConnectionParameters connectionParameters, ImapServerParameters serverParameters)
 {
     this.connectionParameters = connectionParameters;
     this.serverParameters     = serverParameters;
     this.Log             = connectionParameters.Log;
     this.currentResponse = new ImapResponse(this.Log);
 }
Ejemplo n.º 2
0
        // Token: 0x0600003F RID: 63 RVA: 0x0000317C File Offset: 0x0000137C
        public void ConnectAndAuthenticate(ImapServerParameters serverParameters, ImapAuthenticationParameters authenticationParameters, IServerCapabilities capabilities = null)
        {
            base.CheckDisposed();
            this.ThrowIfConnected();
            ImapConnectionContext imapConnectionContext = this.ConnectionContext;

            imapConnectionContext.AuthenticationParameters = authenticationParameters;
            imapConnectionContext.ServerParameters         = serverParameters;
            imapConnectionContext.NetworkFacade            = this.CreateNetworkFacade.Value(this.ConnectionContext, serverParameters);
            AsyncOperationResult <DBNull> asyncOperationResult = ImapConnectionCore.ConnectAndAuthenticate(this.ConnectionContext, capabilities, null, null);

            this.ThrowIfExceptionNotNull(asyncOperationResult.Exception);
        }
Ejemplo n.º 3
0
        // Token: 0x06000040 RID: 64 RVA: 0x000031E4 File Offset: 0x000013E4
        public OperationStatusCode TestLogon(ImapServerParameters serverParameters, ImapAuthenticationParameters authenticationParameters, IServerCapabilities capabilities)
        {
            base.CheckDisposed();
            this.ThrowIfConnected();
            OperationStatusCode result;

            try
            {
                this.ConnectAndAuthenticate(serverParameters, authenticationParameters, capabilities);
                result = OperationStatusCode.Success;
            }
            catch (ImapConnectionException)
            {
                result = OperationStatusCode.ErrorCannotCommunicateWithRemoteServer;
            }
            catch (ImapAuthenticationException ex)
            {
                if (ex.InnerException == null)
                {
                    result = OperationStatusCode.ErrorInvalidCredentials;
                }
                else
                {
                    result = OperationStatusCode.ErrorInvalidRemoteServer;
                }
            }
            catch (ImapCommunicationException)
            {
                result = OperationStatusCode.ErrorInvalidRemoteServer;
            }
            catch (MissingCapabilitiesException)
            {
                result = OperationStatusCode.ErrorUnsupportedProtocolVersion;
            }
            finally
            {
                if (this.IsConnected())
                {
                    ImapConnectionCore.LogOff(this.ConnectionContext, null, null);
                }
            }
            return(result);
        }