예제 #1
0
        private static IncomingServer CreateImap(TimeOutSocket socket)
        {
            IncomingServer incoming = new IncomingServer();

            incoming.Type           = ServerType.IMAP;
            incoming.Port           = socket.Port;
            incoming.Hostname       = socket.Host;
            incoming.Authentication = AuthenticationType.PasswordClearText;
            incoming.UsernameFormat = DefaultUsernameFormat;

            switch (socket.Port)
            {
            case ImapPlain:
                incoming.SocketType = SocketType.Unknown;
                break;

            case ImapSSL:
                incoming.SocketType = SocketType.SSL;
                break;
            }

            return(incoming);
        }
예제 #2
0
        private static OutgoingServer CreateSmtp(TimeOutSocket socket)
        {
            OutgoingServer outgoing = new OutgoingServer();

            outgoing.Type           = ServerType.SMTP;
            outgoing.Port           = socket.Port;
            outgoing.Hostname       = socket.Host;
            outgoing.Authentication = AuthenticationType.PasswordClearText;
            outgoing.UsernameFormat = DefaultUsernameFormat;

            switch (socket.Port)
            {
            case SmtpSSL:
                outgoing.SocketType = SocketType.SSL;
                break;

            case SmtpPlain:
            case SmtpTLS:
                outgoing.SocketType = SocketType.Unknown;
                break;
            }

            return(outgoing);
        }