コード例 #1
0
ファイル: EmailWorkers.cs プロジェクト: xhute/Kooboo
        static EmailWorkers()
        {
            Workers = new List <IWorkerStarter>();
            Workers.Add(new Smtp.SmtpServer("Receive"));

            var imapServer = new Imap.ImapServer(143);

            Workers.Add(imapServer);

            if (Data.AppSettings.IsOnlineServer)
            {
                var serverdomain = Data.AppSettings.ServerSetting.ServerId + "." + Data.AppSettings.ServerSetting.HostDomain;

                var dbcert = Kooboo.Data.GlobalDb.SslCertificate.GetByDomain(serverdomain)?.Content;

                if (dbcert != null)
                {
                    var cert = new System.Security.Cryptography.X509Certificates.X509Certificate2(dbcert, "kooboo");
                    if (cert != null)
                    {
                        var sslimapServer = new Imap.ImapServer(993, Imap.SslMode.SSL, cert);
                        Workers.Add(sslimapServer);

                        var sslSmtp = new Kooboo.Mail.Smtp.SmtpServer("sslreceive", 465, cert);
                        Workers.Add(sslSmtp);
                    }
                }
            }

            Workers.Add(new Smtp.SmtpServer("Relay", 587));
        }
コード例 #2
0
 public ImapSession(ImapServer server, TcpClient client, long connectionId)
 {
     Server    = server;
     TcpClient = client;
     Id        = connectionId;
 }
コード例 #3
0
ファイル: ImapSession.cs プロジェクト: lzporter/Kooboo
 public ImapSession(ImapServer server, TcpClient client)
 {
     Server    = server;
     TcpClient = client;
 }