Settings_Pop3Server.pas
上传用户:dh8233980
上传日期:2014-10-16
资源大小:1015k
文件大小:3k
源码类别:

Email服务器

开发平台:

Delphi

  1. unit Settings_Pop3Server;
  2. (******************************************************************************)
  3. (*                                                                            *)
  4. (* Hermes Pop3 Server Settings Dialog Box                                     *)
  5. (* Part of Hermes SMTP/POP3 Server.                                           *)
  6. (* Copyright(C) 2000 by Alexander J. Fanti, All Rights Reserver Worldwide.    *)
  7. (*                                                                            *)
  8. (* Created January 10, 2000 by Alexander J. Fanti.  See License.txt           *)
  9. (*                                                                            *)
  10. (* Used by: Main                                                              *)
  11. (* Uses: DataU1, WSocket                                                      *)
  12. (*                                                                            *)
  13. (* Description: This Modal dialog window allows the user to change Pop3       *)
  14. (*              server settings                                               *)
  15. (*                                                                            *)
  16. (* Revisions: 1/21/2000  AJF  Commented                                       *)
  17. (*                                                                            *)
  18. (******************************************************************************)
  19. interface
  20. uses
  21.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  22.   Spin, StdCtrls, Buttons;
  23. type
  24.   TfrmSettings_Pop3Server = class(TForm)
  25.     cbxCreateUser: TCheckBox;
  26.     cbxCreatePassword: TCheckBox;
  27.     Label2: TLabel;
  28.     lstAddress: TComboBox;
  29.     Label3: TLabel;
  30.     spePort: TSpinEdit;
  31.     btnOK: TBitBtn;
  32.     btnCancel: TBitBtn;
  33.     Label5: TLabel;
  34.     lblConnectionInactivityTimeout: TLabel;
  35.     speInactivityTimeout: TSpinEdit;
  36.     procedure FormShow(Sender: TObject);
  37.     procedure btnOKClick(Sender: TObject);
  38.   private
  39.     { Private declarations }
  40.   public
  41.     { Public declarations }
  42.   end;
  43. var
  44.   frmSettings_Pop3Server: TfrmSettings_Pop3Server;
  45. implementation
  46. uses WSocket, DataU1;
  47. {$R *.DFM}
  48. procedure TfrmSettings_Pop3Server.FormShow(Sender: TObject);
  49. var
  50.   x : Integer;
  51. begin
  52.   // List available IP addresses (or ANY)
  53.   lstAddress.Clear;
  54.   lstAddress.Items.Add('*** Any ***');
  55.   for x := 0 to LocalIPList.Count -1 do
  56.     lstAddress.Items.Add(LocalIPList[x]);
  57.   // Populate Dialog with Setting Information
  58.   lstAddress.ItemIndex := 0;
  59.   for x := 0 to lstAddress.Items.Count -1 do
  60.     if INI.Pop3_BindAddress = lstAddress.Items[x] then
  61.       lstAddress.ItemIndex := x;
  62.   spePort.Value := INI.Pop3_Port;
  63.   cbxCreateUser.Checked := INI.Pop3_CreateUserOnDemand;
  64.   cbxCreatePassword.Checked := INI.Pop3_CreateUserPasswordOnDemand;
  65.   speInactivityTimeout.Value := INI.Pop3_InactivityTimeout;
  66. end;
  67. procedure TfrmSettings_Pop3Server.btnOKClick(Sender: TObject);
  68. begin
  69.   // Retrieve Settings from Dialog
  70.   if lstAddress.ItemIndex = 0 then INI.Pop3_BindAddress := '0.0.0.0'
  71.     else INI.Pop3_BindAddress := lstAddress.Items[lstAddress.ItemIndex];
  72.   INI.Pop3_Port        := spePort.Value;
  73.   INI.Pop3_CreateUserOnDemand := cbxCreateUser.Checked;
  74.   INI.Pop3_CreateUserPasswordOnDemand := cbxCreatePassword.Checked;
  75.   INI.Pop3_InactivityTimeout := speInactivityTimeout.Value;
  76. end;
  77. end.