public Configuration(PopConnectionSettings InPop, SmtpConnectionSettings InSmtp)
        {
            InitializeComponent();

            this.InPopSrettings = InPop;
            this.InSmtpSettings = InSmtp;

            TempPopSettings  = new PopConnectionSettings();
            TempSmtpSettings = new SmtpConnectionSettings();
            TempPopSettings.CloneFrom(InPop);
            TempSmtpSettings.CloneFrom(InSmtp);

            InPopHostname.Text  = TempPopSettings.Hostname;
            InPopPort.Text      = TempPopSettings.Port.ToString();
            InPopUsername.Text  = TempPopSettings.UserLogin;
            InPopPassword.Text  = TempPopSettings.UserPassword;
            InPopRefrate.Text   = TempPopSettings.RefreshRateSeconds.ToString();
            CheckPopSsl.Checked = TempPopSettings.UseSsl;

            InSmtpHostname.Text  = TempSmtpSettings.Hostname;
            InSmtpPort.Text      = TempSmtpSettings.Port.ToString();
            InSmtpLogin.Text     = TempSmtpSettings.UserLogin;
            InSmtpPassword.Text  = TempSmtpSettings.UserPassword;
            CheckSmtpSsl.Checked = TempSmtpSettings.UseSsl;
        }
 public void PushNewConfig(PopConnectionSettings NewConfig)
 {
     if (Connection.IsConnected() || ServerThread != null)
     {
         throw new Exception("cannot_change_config_at_service_runtime");
     }
     CurrentConfig = NewConfig;
 }
Example #3
0
        private void SetupConfig()
        {
            PopConfig = new PopConnectionSettings();
            if (!PopConfig.TryReadFromFile(ConfigFilenamePop))
            {
                MessageBox.Show("POP3 config file could not be parsed (either missing or corrupted).\nPlease fill your information in the config menu.");
            }

            SmtpConfig = new SmtpConnectionSettings();
            if (!SmtpConfig.TryReadFromFile(ConfigFilenameSmtp))
            {
                MessageBox.Show("SMTP config file could not be parsed (either missing or corrupted).\nPlease fill your information in the config menu.");
            }
        }
Example #4
0
        internal override string BuildVerb()
        {
            Creds = ParentService.GetConfig();

            switch (AuthState)
            {
            case AuthorizationState.NotStarted:
                AuthState = AuthorizationState.SentLogin;
                return("USER " + Creds.UserLogin + EOL);

            case AuthorizationState.AcceptedLogin:
                AuthState = AuthorizationState.SentPassword;
                return("PASS " + Creds.UserPassword + EOL);

            default:
                throw new Exception("no_verbs_left");
            }
        }