Example #1
0
        public AutoResponderService()
        {
            InitializeComponent();
            _log = new SafeLog();
            _cfg = new Conf(_log);
            _cfg.Init();

            if (!EventLog.SourceExists("AutoResponderServiceSource"))
            {
                EventLog.CreateEventSource("AutoResponderServiceSource", "AutoResponderServiceLog");
            }

            _eventLog.Source = "AutoResponderServiceSource";
            _eventLog.Log    = "AutoResponderServiceLog";
            string[] mails     = _cfg.AutoResponderMails.Split(' ');
            string[] passwords = _cfg.AutoResponderPasswords.Split(' ');
            if (mails.Length != passwords.Length)
            {
                _eventLog.WriteEntry("Wrong emails passwords count", EventLogEntryType.Error);
                return;
            }

            for (int i = 0; i < mails.Length; i++)
            {
                ImapIdler ImapIdler;
                try
                {
                    ImapIdler = new ImapIdler(mails[i], passwords[i], _eventLog);
                }
                catch (Exception)
                {
                    continue;
                }
                _imapIdlerList.Add(ImapIdler);
            }
        }
Example #2
0
 public void TestConfBase()
 {
     _cfg = new Conf(_log);
     _cfg.Init();
 }
Example #3
0
 public void Init()
 {
     _cfg = new Conf(_log);
     _cfg.Init();
 }