Skip to content
Snippets Groups Projects
Commit b64f01ee authored by rswindell's avatar rswindell
Browse files

Created an "Advanced" tab which allows the sysop to toggle options that could

previously only be enabled/changed in the sbbs.ini file.
Display "<auto>" if the DNS server field is left blank or set to an invalid IP
address or hostname.
parent 58a38eda
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,10 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender) ...@@ -103,7 +103,10 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port); SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port);
POP3PortEdit->Text=AnsiString(MainForm->mail_startup.pop3_port); POP3PortEdit->Text=AnsiString(MainForm->mail_startup.pop3_port);
RelayPortEdit->Text=AnsiString(MainForm->mail_startup.relay_port); RelayPortEdit->Text=AnsiString(MainForm->mail_startup.relay_port);
DNSServerEdit->Text=AnsiString(MainForm->mail_startup.dns_server); if(isalnum(MainForm->mail_startup.dns_server[0]))
DNSServerEdit->Text=AnsiString(MainForm->mail_startup.dns_server);
else
DNSServerEdit->Text="<auto>";
InboundSoundEdit->Text=AnsiString(MainForm->mail_startup.inbound_sound); InboundSoundEdit->Text=AnsiString(MainForm->mail_startup.inbound_sound);
OutboundSoundEdit->Text=AnsiString(MainForm->mail_startup.outbound_sound); OutboundSoundEdit->Text=AnsiString(MainForm->mail_startup.outbound_sound);
POP3SoundEdit->Text=AnsiString(MainForm->mail_startup.pop3_sound); POP3SoundEdit->Text=AnsiString(MainForm->mail_startup.pop3_sound);
...@@ -159,6 +162,18 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender) ...@@ -159,6 +162,18 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
SendMailCheckBox->Checked= SendMailCheckBox->Checked=
!(MainForm->mail_startup.options&MAIL_OPT_NO_SENDMAIL); !(MainForm->mail_startup.options&MAIL_OPT_NO_SENDMAIL);
int i=0;
AdvancedCheckListBox->Checked[i++]
=(MainForm->mail_startup.options&MAIL_OPT_SEND_INTRANSIT);
AdvancedCheckListBox->Checked[i++]
=(MainForm->mail_startup.options&MAIL_OPT_DEBUG_RX_BODY);
AdvancedCheckListBox->Checked[i++]
=(MainForm->mail_startup.options&MAIL_OPT_ALLOW_RX_BY_NUMBER);
AdvancedCheckListBox->Checked[i++]
=(MainForm->mail_startup.options&MAIL_OPT_DNSBL_CHKRECVHDRS);
AdvancedCheckListBox->Checked[i++]
=(MainForm->mail_startup.options&MAIL_OPT_DNSBL_THROTTLE);
DNSBLRadioButtonClick(Sender); DNSBLRadioButtonClick(Sender);
DNSRadioButtonClick(Sender); DNSRadioButtonClick(Sender);
POP3EnabledCheckBoxClick(Sender); POP3EnabledCheckBoxClick(Sender);
...@@ -168,7 +183,14 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender) ...@@ -168,7 +183,14 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
PageControl->ActivePage=GeneralTabSheet; PageControl->ActivePage=GeneralTabSheet;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void setBit(unsigned long* l, long bit, bool yes)
{
if(yes)
*l|=bit;
else
*l&=~bit;
}
//---------------------------------------------------------------------------
void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender) void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
{ {
char str[128],*p; char str[128],*p;
...@@ -207,8 +229,11 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender) ...@@ -207,8 +229,11 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
SAFECOPY(MainForm->mail_startup.default_user SAFECOPY(MainForm->mail_startup.default_user
,DefaultUserEdit->Text.c_str()); ,DefaultUserEdit->Text.c_str());
SAFECOPY(MainForm->mail_startup.dns_server if(isalnum(*DNSServerEdit->Text.c_str()))
,DNSServerEdit->Text.c_str()); SAFECOPY(MainForm->mail_startup.dns_server
,DNSServerEdit->Text.c_str());
else
MainForm->mail_startup.dns_server[0]=0;
SAFECOPY(MainForm->mail_startup.relay_server SAFECOPY(MainForm->mail_startup.relay_server
,RelayServerEdit->Text.c_str()); ,RelayServerEdit->Text.c_str());
SAFECOPY(MainForm->mail_startup.relay_user SAFECOPY(MainForm->mail_startup.relay_user
...@@ -303,6 +328,23 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender) ...@@ -303,6 +328,23 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
else else
MainForm->mail_startup.options&=~MAIL_OPT_NO_SENDMAIL; MainForm->mail_startup.options&=~MAIL_OPT_NO_SENDMAIL;
int i=0;
setBit(&MainForm->mail_startup.options
,MAIL_OPT_SEND_INTRANSIT
,AdvancedCheckListBox->Checked[i++]);
setBit(&MainForm->mail_startup.options
,MAIL_OPT_DEBUG_RX_BODY
,AdvancedCheckListBox->Checked[i++]);
setBit(&MainForm->mail_startup.options
,MAIL_OPT_ALLOW_RX_BY_NUMBER
,AdvancedCheckListBox->Checked[i++]);
setBit(&MainForm->mail_startup.options
,MAIL_OPT_DNSBL_CHKRECVHDRS
,AdvancedCheckListBox->Checked[i++]);
setBit(&MainForm->mail_startup.options
,MAIL_OPT_DNSBL_THROTTLE
,AdvancedCheckListBox->Checked[i++]);
MainForm->MailAutoStart=AutoStartCheckBox->Checked; MainForm->MailAutoStart=AutoStartCheckBox->Checked;
MainForm->MailLogFile=LogFileCheckBox->Checked; MainForm->MailLogFile=LogFileCheckBox->Checked;
......
...@@ -53,8 +53,8 @@ object MailCfgDlg: TMailCfgDlg ...@@ -53,8 +53,8 @@ object MailCfgDlg: TMailCfgDlg
Top = 4 Top = 4
Width = 342 Width = 342
Height = 245 Height = 245
ActivePage = SoundTabSheet ActivePage = AdvancedTabSheet
TabIndex = 5 TabIndex = 7
TabOrder = 3 TabOrder = 3
object GeneralTabSheet: TTabSheet object GeneralTabSheet: TTabSheet
Caption = 'General' Caption = 'General'
...@@ -818,6 +818,24 @@ object MailCfgDlg: TMailCfgDlg ...@@ -818,6 +818,24 @@ object MailCfgDlg: TMailCfgDlg
TabOrder = 3 TabOrder = 3
end end
end end
object AdvancedTabSheet: TTabSheet
Caption = 'Advanced'
ImageIndex = 7
object AdvancedCheckListBox: TCheckListBox
Left = 16
Top = 16
Width = 305
Height = 185
ItemHeight = 16
Items.Strings = (
'SendMail: Ignore '#39'in transit'#39' attribute'
'Save received mail files in temp directory'
'Allow receipt of mail by user number'
'Check '#39'Received'#39' header fields against DNSBL'
'Throttle DNS blacklisted server sessions')
TabOrder = 0
end
end
end end
object OpenDialog: TOpenDialog object OpenDialog: TOpenDialog
Filter = 'Wave Files|*.wav' Filter = 'Wave Files|*.wav'
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <vcl\System.hpp> #include <vcl\System.hpp>
#include <Dialogs.hpp> #include <Dialogs.hpp>
#include <ComCtrls.hpp> #include <ComCtrls.hpp>
#include <CheckLst.hpp>
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
class TMailCfgDlg : public TForm class TMailCfgDlg : public TForm
{ {
...@@ -139,6 +140,8 @@ __published: ...@@ -139,6 +140,8 @@ __published:
TEdit *RelayAuthNameEdit; TEdit *RelayAuthNameEdit;
TLabel *RelayAuthPassLabel; TLabel *RelayAuthPassLabel;
TEdit *RelayAuthPassEdit; TEdit *RelayAuthPassEdit;
TTabSheet *AdvancedTabSheet;
TCheckListBox *AdvancedCheckListBox;
void __fastcall InboundSoundButtonClick(TObject *Sender); void __fastcall InboundSoundButtonClick(TObject *Sender);
void __fastcall OutboundSoundButtonClick(TObject *Sender); void __fastcall OutboundSoundButtonClick(TObject *Sender);
void __fastcall FormShow(TObject *Sender); void __fastcall FormShow(TObject *Sender);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment