--- sbbs/src/sbbs3/ctrl/mailcfgdlgunit.cpp 2018/04/24 16:41:24 1.1 +++ sbbs/src/sbbs3/ctrl/mailcfgdlgunit.cpp 2018/04/24 16:44:02 1.1.1.2 @@ -1,12 +1,12 @@ /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */ -/* $Id: mailcfgdlgunit.cpp,v 1.1 2018/04/24 16:41:24 root Exp $ */ +/* $Id: mailcfgdlgunit.cpp,v 1.1.1.2 2018/04/24 16:44:02 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -96,12 +96,14 @@ void __fastcall TMailCfgDlg::FormShow(TO LogFileCheckBox->Checked=MainForm->MailLogFile; HostnameCheckBox->Checked =!(MainForm->mail_startup.options&MAIL_OPT_NO_HOST_LOOKUP); + UseSubPortCheckBox->Checked=MainForm->mail_startup.options&MAIL_OPT_USE_SUBMISSION_PORT; DefCharsetEdit->Text=AnsiString(MainForm->mail_startup.default_charset); RelayServerEdit->Text=AnsiString(MainForm->mail_startup.relay_server); RelayAuthNameEdit->Text=AnsiString(MainForm->mail_startup.relay_user); RelayAuthPassEdit->Text=AnsiString(MainForm->mail_startup.relay_pass); SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port); + SubPortEdit->Text=AnsiString(MainForm->mail_startup.submission_port); POP3PortEdit->Text=AnsiString(MainForm->mail_startup.pop3_port); RelayPortEdit->Text=AnsiString(MainForm->mail_startup.relay_port); if(isalnum(MainForm->mail_startup.dns_server[0])) @@ -155,8 +157,8 @@ void __fastcall TMailCfgDlg::FormShow(TO BLIgnoreRadioButton->Checked=true; else BLTagRadioButton->Checked=true; - BLDebugCheckBox->Checked=MainForm->mail_startup.options - &MAIL_OPT_DNSBL_DEBUG; + DNSBLSpamHashCheckBox->Checked=MainForm->mail_startup.options + &MAIL_OPT_DNSBL_SPAMHASH; TcpDnsCheckBox->Checked=MainForm->mail_startup.options &MAIL_OPT_USE_TCP_DNS; @@ -171,9 +173,14 @@ void __fastcall TMailCfgDlg::FormShow(TO AdvancedCheckListBox->Checked[i++] =(MainForm->mail_startup.options&MAIL_OPT_ALLOW_RX_BY_NUMBER); AdvancedCheckListBox->Checked[i++] + =(MainForm->mail_startup.options&MAIL_OPT_ALLOW_SYSOP_ALIASES); + + AdvancedCheckListBox->Checked[i++] =(MainForm->mail_startup.options&MAIL_OPT_DNSBL_CHKRECVHDRS); AdvancedCheckListBox->Checked[i++] =(MainForm->mail_startup.options&MAIL_OPT_DNSBL_THROTTLE); + AdvancedCheckListBox->Checked[i++] + =!(MainForm->mail_startup.options&MAIL_OPT_NO_AUTO_EXEMPT); DNSBLRadioButtonClick(Sender); DNSRadioButtonClick(Sender); @@ -181,6 +188,7 @@ void __fastcall TMailCfgDlg::FormShow(TO SendMailCheckBoxClick(Sender); AllowRelayCheckBoxClick(Sender); RelayAuthRadioButtonClick(Sender); + UseSubPortCheckBoxClick(Sender); PageControl->ActivePage=GeneralTabSheet; } //--------------------------------------------------------------------------- @@ -215,9 +223,10 @@ void __fastcall TMailCfgDlg::OKBtnClick( } else MainForm->mail_startup.interface_addr=0; - MainForm->mail_startup.smtp_port=SMTPPortEdit->Text.ToIntDef(25); - MainForm->mail_startup.pop3_port=POP3PortEdit->Text.ToIntDef(110); - MainForm->mail_startup.relay_port=RelayPortEdit->Text.ToIntDef(25); + MainForm->mail_startup.smtp_port=SMTPPortEdit->Text.ToIntDef(IPPORT_SMTP); + MainForm->mail_startup.submission_port=SubPortEdit->Text.ToIntDef(IPPORT_SUBMISSION); + MainForm->mail_startup.pop3_port=POP3PortEdit->Text.ToIntDef(IPPORT_POP3); + MainForm->mail_startup.relay_port=RelayPortEdit->Text.ToIntDef(IPPORT_SMTP); MainForm->mail_startup.max_clients=MaxClientsEdit->Text.ToIntDef(10); MainForm->mail_startup.max_inactivity=MaxInactivityEdit->Text.ToIntDef(120); MainForm->mail_startup.max_recipients=MaxRecipientsEdit->Text.ToIntDef(100); @@ -289,12 +298,6 @@ void __fastcall TMailCfgDlg::OKBtnClick( MainForm->mail_startup.options|=MAIL_OPT_DEBUG_POP3; else MainForm->mail_startup.options&=~MAIL_OPT_DEBUG_POP3; -#if 0 /* this is a stupid option */ - if(UserNumberCheckBox->Checked==true) - MainForm->mail_startup.options|=MAIL_OPT_ALLOW_RX_BY_NUMBER; - else - MainForm->mail_startup.options&=~MAIL_OPT_ALLOW_RX_BY_NUMBER; -#endif if(AllowRelayCheckBox->Checked==true) MainForm->mail_startup.options|=MAIL_OPT_ALLOW_RELAY; else @@ -303,6 +306,10 @@ void __fastcall TMailCfgDlg::OKBtnClick( MainForm->mail_startup.options|=MAIL_OPT_SMTP_AUTH_VIA_IP; else MainForm->mail_startup.options&=~MAIL_OPT_SMTP_AUTH_VIA_IP; + if(UseSubPortCheckBox->Checked==true) + MainForm->mail_startup.options|=MAIL_OPT_USE_SUBMISSION_PORT; + else + MainForm->mail_startup.options&=~MAIL_OPT_USE_SUBMISSION_PORT; /* DNSBL */ MainForm->mail_startup.options&= @@ -313,10 +320,10 @@ void __fastcall TMailCfgDlg::OKBtnClick( MainForm->mail_startup.options|=MAIL_OPT_DNSBL_REFUSE; else if(BLBadUserRadioButton->Checked==true) MainForm->mail_startup.options|=MAIL_OPT_DNSBL_BADUSER; - if(BLDebugCheckBox->Checked==true) - MainForm->mail_startup.options|=MAIL_OPT_DNSBL_DEBUG; + if(DNSBLSpamHashCheckBox->Checked==true) + MainForm->mail_startup.options|=MAIL_OPT_DNSBL_SPAMHASH; else - MainForm->mail_startup.options&=~MAIL_OPT_DNSBL_DEBUG; + MainForm->mail_startup.options&=~MAIL_OPT_DNSBL_SPAMHASH; if(HostnameCheckBox->Checked==false) MainForm->mail_startup.options|=MAIL_OPT_NO_HOST_LOOKUP; @@ -342,11 +349,17 @@ void __fastcall TMailCfgDlg::OKBtnClick( ,MAIL_OPT_ALLOW_RX_BY_NUMBER ,AdvancedCheckListBox->Checked[i++]); setBit(&MainForm->mail_startup.options + ,MAIL_OPT_ALLOW_SYSOP_ALIASES + ,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++]); + setBit(&MainForm->mail_startup.options + ,MAIL_OPT_NO_AUTO_EXEMPT + ,!AdvancedCheckListBox->Checked[i++]); MainForm->MailAutoStart=AutoStartCheckBox->Checked; MainForm->MailLogFile=LogFileCheckBox->Checked; @@ -420,6 +433,8 @@ void __fastcall TMailCfgDlg::DNSBLRadioB BLHeaderEdit->Enabled=BLTagRadioButton->Checked; BLSubjectLabel->Enabled=BLTagRadioButton->Checked; BLHeaderLabel->Enabled=BLTagRadioButton->Checked; + DNSBLSpamHashCheckBox->Enabled + =(BLTagRadioButton->Checked || BLIgnoreRadioButton->Checked); } //--------------------------------------------------------------------------- @@ -467,3 +482,12 @@ void __fastcall TMailCfgDlg::RelayAuthRa } //--------------------------------------------------------------------------- +void __fastcall TMailCfgDlg::UseSubPortCheckBoxClick(TObject *Sender) +{ + bool enabled = UseSubPortCheckBox->Checked; + + SubPortLabel->Enabled = enabled; + SubPortEdit->Enabled = enabled; +} +//--------------------------------------------------------------------------- +