Beispiel #1
0
 public WebDavDb(Kernel kernel, string nameTag)
 {
     NameTag = nameTag;
     _fileName = string.Format("{0}\\webdav.{1}.db", kernel.ProgDir(), Util.SwapChar(':', '-', nameTag));
     //ファイルからの読み込み
     if (File.Exists(_fileName)) {
         using (var sr = new StreamReader(_fileName, Encoding.GetEncoding("Shift_JIS"))) {
             while (true) {
                 string str = sr.ReadLine();
                 if (str == null)
                     break;
                 var oneWebDavDb = new OneWebDavDb(Inet.TrimCrlf(str));
                 if (oneWebDavDb.Uri != "") {
                     _ar.Add(oneWebDavDb);
                 }
             }
             sr.Close();
         }
     }
 }
Beispiel #2
0
        readonly string _wpadUrl; //WPAD

        #endregion Fields

        #region Constructors

        //�R���X�g���N�^
        public Server(Kernel kernel, Conf conf,OneBind oneBind)
            : base(kernel, conf, oneBind)
        {
            //�I�v�V�����̓ǂݍ���
                _maskIp = (Ip)Conf.Get("maskIp");
                _gwIp = (Ip)Conf.Get("gwIp");
                _dnsIp0 = (Ip)Conf.Get("dnsIp0");
                _dnsIp1 = (Ip)Conf.Get("dnsIp1");
                _leaseTime = (int)Conf.Get("leaseTime");
            if (_leaseTime <= 0)
                _leaseTime = 86400;
            if ((bool)Conf.Get("useWpad")) {
                _wpadUrl = (string)Conf.Get("wpadUrl");
            }

            //DB����
            string fileName = string.Format("{0}\\lease.db", kernel.ProgDir());
            var startIp = (Ip)Conf.Get("startIp");
            var endIp = (Ip)Conf.Get("endIp");
            _macAcl = (Dat)Conf.Get("macAcl");
            //�ݒ肪�����ꍇ�́A���Dat�𐶐�����
            if (_macAcl == null){
                _macAcl = new Dat(new CtrlType[]{CtrlType.TextBox,CtrlType.AddressV4, CtrlType.TextBox});
            }

            //Ver5.6.8
            //�J�������u���O�i�\����)�v�𑝂₵�����Ƃɂ��݊����ێ�
            if (_macAcl.Count > 0) {
                foreach (OneDat t in _macAcl){
                    if (t.StrList.Count == 2) {
                        t.StrList.Add(string.Format("host_{0}",t.StrList[1]));
                    }
                }
            }
            _lease = new Lease(fileName, startIp, endIp, _leaseTime, _macAcl);

            //�T�[�o�A�h���X�̏�����
            _serverAddress = Define.ServerAddress();
        }
Beispiel #3
0
        Fetch _fetch; //自動受信

        #endregion Fields

        #region Constructors

        //#endif
        //コンストラクタ
        public Server(Kernel kernel, Conf conf, OneBind oneBind)
            : base(kernel, conf, oneBind)
        {
            //Ver5.8.9
            if (kernel.RunMode == RunMode.Normal || kernel.RunMode == RunMode.Service) {
                //メールボックスの初期化状態確認
                if (kernel.MailBox == null || !kernel.MailBox.Status) {
                    Logger.Set(LogKind.Error, null, 4, "");
                    return; //初期化失敗(サーバは機能しない)
                }
            }

            //ドメイン名のリスト整備
            DomainList = new List<string>();
            foreach (var s in ((string)Conf.Get("domainName")).Split(',')) {
                //Ver6.1.9
                // 設定時に誤って空白が入ってしまった際、強制的に削除する
                DomainList.Add(s.Trim());
                //DomainList.Add(s);
            }
            if (DomainList.Count == 0) {
                Logger.Set(LogKind.Error, null, 3, "");
                return;//初期化失敗(サーバは機能しない)
            }

            //エリアス初期化
            Alias = new Alias(DomainList, kernel.MailBox);
            foreach (var dat in (Dat)Conf.Get("aliasList")) {
                if (dat.Enable) {
                    var name = dat.StrList[0];
                    var alias = dat.StrList[1];
                    Alias.Add(name, alias, Logger);
                }
            }

            //メールキューの初期化
            _mailQueue = new MailQueue(kernel.ProgDir());

            //SaveMail初期化
            var receivedHeader = new ReceivedHeader(kernel, (string)Conf.Get("receivedHeader"));
            _mailSave = new MailSave(kernel.MailBox,Alias, _mailQueue,Logger, receivedHeader, DomainList);

            var always = (bool)Conf.Get("always");//キュー常時処理
            _agent = new Agent(kernel, this, Conf, Logger, _mailQueue, always);

            //中継許可の初期化
            _relay = new Relay((Dat)Conf.Get("allowList"), (Dat)Conf.Get("denyList"), (int)Conf.Get("order"), Logger);

            //PopBeforeSmtp
            _popBeforeSmtp = new PopBeforeSmtp((bool)conf.Get("usePopBeforeSmtp"), (int)conf.Get("timePopBeforeSmtp"), kernel.MailBox);

            //usePopAccountがfalseの時、内部でmailBoxが無効化される
            _smtpAuthUserList = new SmtpAuthUserList((bool)Conf.Get("usePopAcount"), Kernel.MailBox, (Dat)Conf.Get("esmtpUserList"));
            _smtpAuthRange = new SmtpAuthRange((Dat)Conf.Get("range"), (int)Conf.Get("enableEsmtp"), Logger);

            //ヘッダ置換
            _changeHeader = new ChangeHeader((Dat)Conf.Get("patternList"), (Dat)Conf.Get("appendList"));

            //Ver5.3.3 Ver5.2以前のバージョンのカラムの違いを修正する
            var d = (Dat)Conf.Get("hostList");
            if (d.Count > 0 && d[0].StrList.Count == 6) {
                foreach (var o in d) {
                    o.StrList.Add("False");
                }
                conf.Set("hostList", d);
                conf.Save(kernel.IniDb);
            }

            //#if ML_SERVER
            _mlList = new MlList(kernel,this,_mailSave, DomainList);
            //#endif
        }
Beispiel #4
0
        private readonly WebApi _webApi; //コントロール

        #endregion Fields

        #region Constructors

        public SvMail(Kernel kernel)
        {
            _webApi = kernel.WebApi;
            _mailBox = kernel.MailBox;
            _mailQueue = kernel.ProgDir() + "\\MailQueue";
        }