Exemplo n.º 1
0
        public override IDnsSettings GetFreeDnsRecords(IMailServerFactory factory)
        {
            var dnsDto = TeamlabDnsDal.GetFreeDnsRecords() ??
                         TeamlabDnsDal.CreateFreeDnsRecords(SetupInfo.DnsPresets.DkimSelector, SetupInfo.DnsPresets.DomainCheckPrefix, SetupInfo.DnsPresets.SpfValue);

            var txtName = SetupInfo.DnsPresets.CurrentOrigin;
            var dns     = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, "", dnsDto.dkim_selector,
                                                    dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                    dnsDto.domain_chek, txtName, dnsDto.spf,
                                                    SetupInfo.DnsPresets.MxHost, SetupInfo.DnsPresets.MxPriority);

            return(dns);
        }
Exemplo n.º 2
0
        public IDnsSettings GetDns(IMailServerFactory factory)
        {
            var dnsDto = TeamlabDnsDal.GetDomainDnsRecords(Id);

            if (dnsDto == null)
            {
                return(null);
            }

            var txtName = Server.SetupInfo.DnsPresets.CurrentOrigin;
            var dns     = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, Name, dnsDto.dkim_selector,
                                                    dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                    dnsDto.domain_chek, txtName, dnsDto.spf,
                                                    Server.SetupInfo.DnsPresets.MxHost, Server.SetupInfo.DnsPresets.MxPriority, Server.Logger);

            return(dns);
        }
Exemplo n.º 3
0
        public IDnsSettings AddDns(int dnsId, IMailServerFactory factory)
        {
            IDnsSettings dnsRecords;
            using (var dbContextWithTran = TeamlabDnsDal.CreateMailDbContext(true))
            {
                var dnsDto = TeamlabDnsDal.LinkDnsToDomain(dnsId, Id, dbContextWithTran.DbManager);
                var txtName = Server.SetupInfo.DnsPresets.CurrentOrigin;

                dnsRecords = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, Name, dnsDto.dkim_selector,
                                                        dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                        dnsDto.domain_chek, txtName, dnsDto.spf,
                                                        Server.SetupInfo.DnsPresets.MxHost, Server.SetupInfo.DnsPresets.MxPriority, Server.Logger);

                var dkimBase = new DkimRecordBase(dnsRecords.DkimSelector, dnsRecords.DkimPrivateKey,
                                                   dnsRecords.DkimPublicKey);

                _AddDkim(dkimBase);

                dbContextWithTran.CommitTransaction();
            }

            return dnsRecords;
        }
Exemplo n.º 4
0
        public IDnsSettings AddDns(int dnsId, IMailServerFactory factory)
        {
            IDnsSettings dnsRecords;

            using (var dbContextWithTran = TeamlabDnsDal.CreateMailDbContext(true))
            {
                var dnsDto  = TeamlabDnsDal.LinkDnsToDomain(dnsId, Id, dbContextWithTran.DbManager);
                var txtName = Server.SetupInfo.DnsPresets.CurrentOrigin;

                dnsRecords = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, Name, dnsDto.dkim_selector,
                                                       dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                       dnsDto.domain_chek, txtName, dnsDto.spf,
                                                       Server.SetupInfo.DnsPresets.MxHost, Server.SetupInfo.DnsPresets.MxPriority, Server.Logger);

                var dkimBase = new DkimRecordBase(dnsRecords.DkimSelector, dnsRecords.DkimPrivateKey,
                                                  dnsRecords.DkimPublicKey);

                _AddDkim(dkimBase);

                dbContextWithTran.CommitTransaction();
            }

            return(dnsRecords);
        }
Exemplo n.º 5
0
        public IDnsSettings GetDns(IMailServerFactory factory)
        {
            var dnsDto = TeamlabDnsDal.GetDomainDnsRecords(Id);

            if (dnsDto == null) return null;

            var txtName = Server.SetupInfo.DnsPresets.CurrentOrigin;
            var dns = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, Name, dnsDto.dkim_selector,
                                                dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                dnsDto.domain_chek, txtName, dnsDto.spf,
                                                Server.SetupInfo.DnsPresets.MxHost, Server.SetupInfo.DnsPresets.MxPriority, Server.Logger);

            return dns;
        }
Exemplo n.º 6
0
        public override IDnsSettings GetFreeDnsRecords(IMailServerFactory factory)
        {
            var dnsDto = TeamlabDnsDal.GetFreeDnsRecords() ??
                TeamlabDnsDal.CreateFreeDnsRecords(SetupInfo.DnsPresets.DkimSelector, SetupInfo.DnsPresets.DomainCheckPrefix, SetupInfo.DnsPresets.SpfValue);

            var txtName = SetupInfo.DnsPresets.CurrentOrigin;
            var dns = factory.CreateDnsSettings(dnsDto.id, dnsDto.tenant, dnsDto.user, "", dnsDto.dkim_selector,
                                                dnsDto.dkim_private_key, dnsDto.dkim_public_key, txtName,
                                                dnsDto.domain_chek, txtName, dnsDto.spf, 
                                                SetupInfo.DnsPresets.MxHost, SetupInfo.DnsPresets.MxPriority);

           return dns;
        }