Annotation of sbbs/src/sbbs3/ctrl/mailcfgdlgunit.cpp, revision 1.1

1.1     ! root        1: /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
        !             2: 
        !             3: /* $Id: MailCfgDlgUnit.cpp,v 1.22 2006/12/27 06:30:13 rswindell Exp $ */
        !             4: 
        !             5: /****************************************************************************
        !             6:  * @format.tab-size 4          (Plain Text/Source Code File Header)                    *
        !             7:  * @format.use-tabs true       (see http://www.synchro.net/ptsc_hdr.html)              *
        !             8:  *                                                                                                                                                     *
        !             9:  * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html         *
        !            10:  *                                                                                                                                                     *
        !            11:  * This program is free software; you can redistribute it and/or                       *
        !            12:  * modify it under the terms of the GNU General Public License                         *
        !            13:  * as published by the Free Software Foundation; either version 2                      *
        !            14:  * of the License, or (at your option) any later version.                                      *
        !            15:  * See the GNU General Public License for more details: gpl.txt or                     *
        !            16:  * http://www.fsf.org/copyleft/gpl.html                                                                                *
        !            17:  *                                                                                                                                                     *
        !            18:  * Anonymous FTP access to the most recent released source is available at     *
        !            19:  * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net     *
        !            20:  *                                                                                                                                                     *
        !            21:  * Anonymous CVS access to the development source and modification history     *
        !            22:  * is available at cvs.synchro.net:/cvsroot/sbbs, example:                                     *
        !            23:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs login                       *
        !            24:  *     (just hit return, no password is necessary)                                                     *
        !            25:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src                *
        !            26:  *                                                                                                                                                     *
        !            27:  * For Synchronet coding style and modification guidelines, see                                *
        !            28:  * http://www.synchro.net/source.html                                                                          *
        !            29:  *                                                                                                                                                     *
        !            30:  * You are encouraged to submit any modifications (preferably in Unix diff     *
        !            31:  * format) via e-mail to [email protected]                                                                      *
        !            32:  *                                                                                                                                                     *
        !            33:  * Note: If this box doesn't appear square, then you need to fix your tabs.    *
        !            34:  ****************************************************************************/
        !            35: 
        !            36: //---------------------------------------------------------------------
        !            37: #include <vcl.h>
        !            38: #pragma hdrstop
        !            39: 
        !            40: #include "MainFormUnit.h"
        !            41: #include "MailCfgDlgUnit.h"
        !            42: #include "TextFileEditUnit.h"
        !            43: #include <stdio.h>                     // sprintf()
        !            44: #include <mmsystem.h>          // sndPlaySound()
        !            45: //---------------------------------------------------------------------
        !            46: #pragma resource "*.dfm"
        !            47: TMailCfgDlg *MailCfgDlg;
        !            48: //---------------------------------------------------------------------
        !            49: __fastcall TMailCfgDlg::TMailCfgDlg(TComponent* AOwner)
        !            50:        : TForm(AOwner)
        !            51: {
        !            52: }
        !            53: //---------------------------------------------------------------------
        !            54: void __fastcall TMailCfgDlg::InboundSoundButtonClick(TObject *Sender)
        !            55: {
        !            56:        OpenDialog->FileName=InboundSoundEdit->Text;
        !            57:        if(OpenDialog->Execute()==true) {
        !            58:        InboundSoundEdit->Text=OpenDialog->FileName;
        !            59:         sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC);
        !            60:     }
        !            61: }
        !            62: //---------------------------------------------------------------------------
        !            63: 
        !            64: void __fastcall TMailCfgDlg::OutboundSoundButtonClick(TObject *Sender)
        !            65: {
        !            66:        OpenDialog->FileName=OutboundSoundEdit->Text;
        !            67:        if(OpenDialog->Execute()==true) {
        !            68:        OutboundSoundEdit->Text=OpenDialog->FileName;
        !            69:         sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC);
        !            70:        }
        !            71: }
        !            72: //---------------------------------------------------------------------------
        !            73: 
        !            74: void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
        !            75: {
        !            76:     char str[128];
        !            77: 
        !            78:     if(MainForm->mail_startup.interface_addr==0)
        !            79:         NetworkInterfaceEdit->Text="<ANY>";
        !            80:     else {
        !            81:         sprintf(str,"%d.%d.%d.%d"
        !            82:             ,(MainForm->mail_startup.interface_addr>>24)&0xff
        !            83:             ,(MainForm->mail_startup.interface_addr>>16)&0xff
        !            84:             ,(MainForm->mail_startup.interface_addr>>8)&0xff
        !            85:             ,MainForm->mail_startup.interface_addr&0xff
        !            86:         );
        !            87:         NetworkInterfaceEdit->Text=AnsiString(str);
        !            88:     }
        !            89:     MaxClientsEdit->Text=AnsiString(MainForm->mail_startup.max_clients);
        !            90:     MaxInactivityEdit->Text=AnsiString(MainForm->mail_startup.max_inactivity);
        !            91:        MaxRecipientsEdit->Text=AnsiString(MainForm->mail_startup.max_recipients);
        !            92:        MaxMsgSizeEdit->Text=AnsiString(MainForm->mail_startup.max_msg_size);
        !            93:     LinesPerYieldEdit->Text=AnsiString(MainForm->mail_startup.lines_per_yield);
        !            94: 
        !            95:     AutoStartCheckBox->Checked=MainForm->MailAutoStart;
        !            96:     LogFileCheckBox->Checked=MainForm->MailLogFile;
        !            97:     HostnameCheckBox->Checked
        !            98:         =!(MainForm->mail_startup.options&MAIL_OPT_NO_HOST_LOOKUP);
        !            99: 
        !           100:     DefCharsetEdit->Text=AnsiString(MainForm->mail_startup.default_charset);
        !           101:     RelayServerEdit->Text=AnsiString(MainForm->mail_startup.relay_server);
        !           102:     RelayAuthNameEdit->Text=AnsiString(MainForm->mail_startup.relay_user);
        !           103:     RelayAuthPassEdit->Text=AnsiString(MainForm->mail_startup.relay_pass);
        !           104:     SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port);
        !           105:     POP3PortEdit->Text=AnsiString(MainForm->mail_startup.pop3_port);
        !           106:     RelayPortEdit->Text=AnsiString(MainForm->mail_startup.relay_port);
        !           107:     if(isalnum(MainForm->mail_startup.dns_server[0]))
        !           108:         DNSServerEdit->Text=AnsiString(MainForm->mail_startup.dns_server);
        !           109:     else
        !           110:         DNSServerEdit->Text="<auto>";
        !           111:     InboundSoundEdit->Text=AnsiString(MainForm->mail_startup.inbound_sound);
        !           112:     OutboundSoundEdit->Text=AnsiString(MainForm->mail_startup.outbound_sound);
        !           113:     POP3SoundEdit->Text=AnsiString(MainForm->mail_startup.pop3_sound);
        !           114:     DeliveryAttemptsEdit->Text
        !           115:         =AnsiString(MainForm->mail_startup.max_delivery_attempts);
        !           116:     RescanFreqEdit->Text=AnsiString(MainForm->mail_startup.rescan_frequency);
        !           117:     DefaultUserEdit->Text=AnsiString(MainForm->mail_startup.default_user);
        !           118:     BLSubjectEdit->Text=AnsiString(MainForm->mail_startup.dnsbl_tag);
        !           119:     BLHeaderEdit->Text=AnsiString(MainForm->mail_startup.dnsbl_hdr);
        !           120: 
        !           121:     DebugTXCheckBox->Checked=MainForm->mail_startup.options
        !           122:         &MAIL_OPT_DEBUG_TX;
        !           123:     DebugRXCheckBox->Checked=MainForm->mail_startup.options
        !           124:         &MAIL_OPT_DEBUG_RX_RSP;
        !           125:     DebugHeadersCheckBox->Checked=MainForm->mail_startup.options
        !           126:         &MAIL_OPT_DEBUG_RX_HEADER;
        !           127:     NotifyCheckBox->Checked
        !           128:        =!(MainForm->mail_startup.options&MAIL_OPT_NO_NOTIFY);
        !           129:     POP3EnabledCheckBox->Checked=MainForm->mail_startup.options
        !           130:         &MAIL_OPT_ALLOW_POP3;
        !           131:     POP3LogCheckBox->Checked=MainForm->mail_startup.options
        !           132:         &MAIL_OPT_DEBUG_POP3;
        !           133:     RelayRadioButton->Checked=MainForm->mail_startup.options
        !           134:        &MAIL_OPT_RELAY_TX;
        !           135:     RelayAuthPlainRadioButton->Checked=MainForm->mail_startup.options
        !           136:         &MAIL_OPT_RELAY_AUTH_PLAIN;
        !           137:     RelayAuthLoginRadioButton->Checked=MainForm->mail_startup.options
        !           138:         &MAIL_OPT_RELAY_AUTH_LOGIN;
        !           139:     RelayAuthCramMD5RadioButton->Checked=MainForm->mail_startup.options
        !           140:         &MAIL_OPT_RELAY_AUTH_CRAM_MD5;
        !           141: 
        !           142: #if 0 /* this is a stupid option */
        !           143:     UserNumberCheckBox->Checked=MainForm->mail_startup.options
        !           144:        &MAIL_OPT_ALLOW_RX_BY_NUMBER;
        !           145: #endif
        !           146:     AllowRelayCheckBox->Checked=MainForm->mail_startup.options
        !           147:        &MAIL_OPT_ALLOW_RELAY;
        !           148:     AuthViaIpCheckBox->Checked=MainForm->mail_startup.options
        !           149:        &MAIL_OPT_SMTP_AUTH_VIA_IP;
        !           150:     if(MainForm->mail_startup.options&MAIL_OPT_DNSBL_REFUSE)
        !           151:            BLRefuseRadioButton->Checked=true;
        !           152:     else if(MainForm->mail_startup.options&MAIL_OPT_DNSBL_BADUSER)
        !           153:            BLBadUserRadioButton->Checked=true;
        !           154:     else if(MainForm->mail_startup.options&MAIL_OPT_DNSBL_IGNORE)
        !           155:            BLIgnoreRadioButton->Checked=true;
        !           156:        else
        !           157:            BLTagRadioButton->Checked=true;
        !           158:     BLDebugCheckBox->Checked=MainForm->mail_startup.options
        !           159:        &MAIL_OPT_DNSBL_DEBUG;
        !           160: 
        !           161:     TcpDnsCheckBox->Checked=MainForm->mail_startup.options
        !           162:        &MAIL_OPT_USE_TCP_DNS;
        !           163:     SendMailCheckBox->Checked=
        !           164:         !(MainForm->mail_startup.options&MAIL_OPT_NO_SENDMAIL);
        !           165: 
        !           166:     int i=0;
        !           167:     AdvancedCheckListBox->Checked[i++]
        !           168:         =(MainForm->mail_startup.options&MAIL_OPT_SEND_INTRANSIT);
        !           169:     AdvancedCheckListBox->Checked[i++]
        !           170:         =(MainForm->mail_startup.options&MAIL_OPT_DEBUG_RX_BODY);
        !           171:     AdvancedCheckListBox->Checked[i++]
        !           172:         =(MainForm->mail_startup.options&MAIL_OPT_ALLOW_RX_BY_NUMBER);
        !           173:     AdvancedCheckListBox->Checked[i++]
        !           174:         =(MainForm->mail_startup.options&MAIL_OPT_DNSBL_CHKRECVHDRS);
        !           175:     AdvancedCheckListBox->Checked[i++]
        !           176:         =(MainForm->mail_startup.options&MAIL_OPT_DNSBL_THROTTLE);
        !           177: 
        !           178:     DNSBLRadioButtonClick(Sender);
        !           179:     DNSRadioButtonClick(Sender);
        !           180:        POP3EnabledCheckBoxClick(Sender);
        !           181:     SendMailCheckBoxClick(Sender);
        !           182:     AllowRelayCheckBoxClick(Sender);
        !           183:     RelayAuthRadioButtonClick(Sender);
        !           184:     PageControl->ActivePage=GeneralTabSheet;
        !           185: }
        !           186: //---------------------------------------------------------------------------
        !           187: static void setBit(unsigned long* l, long bit, bool yes)
        !           188: {
        !           189:     if(yes)
        !           190:         *l|=bit;
        !           191:     else
        !           192:         *l&=~bit;
        !           193: }
        !           194: //---------------------------------------------------------------------------
        !           195: void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
        !           196: {
        !           197:     char    str[128],*p;
        !           198:     DWORD   addr;
        !           199: 
        !           200:     SAFECOPY(str,NetworkInterfaceEdit->Text.c_str());
        !           201:     p=str;
        !           202:     while(*p && *p<=' ') p++;
        !           203:     if(*p && isdigit(*p)) {
        !           204:         addr=atoi(p)<<24;
        !           205:         while(*p && *p!='.') p++;
        !           206:         if(*p=='.') p++;
        !           207:         addr|=atoi(p)<<16;
        !           208:         while(*p && *p!='.') p++;
        !           209:         if(*p=='.') p++;
        !           210:         addr|=atoi(p)<<8;
        !           211:         while(*p && *p!='.') p++;
        !           212:         if(*p=='.') p++;
        !           213:         addr|=atoi(p);
        !           214:         MainForm->mail_startup.interface_addr=addr;
        !           215:     } else
        !           216:         MainForm->mail_startup.interface_addr=0;
        !           217: 
        !           218:        MainForm->mail_startup.smtp_port=SMTPPortEdit->Text.ToIntDef(25);
        !           219:     MainForm->mail_startup.pop3_port=POP3PortEdit->Text.ToIntDef(110);
        !           220:     MainForm->mail_startup.relay_port=RelayPortEdit->Text.ToIntDef(25);
        !           221:     MainForm->mail_startup.max_clients=MaxClientsEdit->Text.ToIntDef(10);
        !           222:     MainForm->mail_startup.max_inactivity=MaxInactivityEdit->Text.ToIntDef(120);
        !           223:     MainForm->mail_startup.max_recipients=MaxRecipientsEdit->Text.ToIntDef(100);
        !           224:     MainForm->mail_startup.max_msg_size
        !           225:        =MaxMsgSizeEdit->Text.ToIntDef(MainForm->mail_startup.max_msg_size);
        !           226:     MainForm->mail_startup.max_delivery_attempts
        !           227:         =DeliveryAttemptsEdit->Text.ToIntDef(10);
        !           228:     MainForm->mail_startup.rescan_frequency=RescanFreqEdit->Text.ToIntDef(300);
        !           229:     MainForm->mail_startup.lines_per_yield=LinesPerYieldEdit->Text.ToIntDef(10);
        !           230: 
        !           231:     SAFECOPY(MainForm->mail_startup.default_charset
        !           232:         ,DefCharsetEdit->Text.c_str());
        !           233:     SAFECOPY(MainForm->mail_startup.default_user
        !           234:         ,DefaultUserEdit->Text.c_str());
        !           235:     if(isalnum(*DNSServerEdit->Text.c_str()))
        !           236:         SAFECOPY(MainForm->mail_startup.dns_server
        !           237:             ,DNSServerEdit->Text.c_str());
        !           238:     else
        !           239:         MainForm->mail_startup.dns_server[0]=0;
        !           240:     SAFECOPY(MainForm->mail_startup.relay_server
        !           241:         ,RelayServerEdit->Text.c_str());
        !           242:     SAFECOPY(MainForm->mail_startup.relay_user
        !           243:         ,RelayAuthNameEdit->Text.c_str());
        !           244:     SAFECOPY(MainForm->mail_startup.relay_pass
        !           245:         ,RelayAuthPassEdit->Text.c_str());
        !           246:     SAFECOPY(MainForm->mail_startup.inbound_sound
        !           247:         ,InboundSoundEdit->Text.c_str());
        !           248:     SAFECOPY(MainForm->mail_startup.outbound_sound
        !           249:         ,OutboundSoundEdit->Text.c_str());
        !           250:     SAFECOPY(MainForm->mail_startup.pop3_sound
        !           251:         ,POP3SoundEdit->Text.c_str());
        !           252:     SAFECOPY(MainForm->mail_startup.dnsbl_tag
        !           253:        ,BLSubjectEdit->Text.c_str());
        !           254:     SAFECOPY(MainForm->mail_startup.dnsbl_hdr
        !           255:        ,BLHeaderEdit->Text.c_str());
        !           256: 
        !           257:        if(RelayRadioButton->Checked==true)
        !           258:        MainForm->mail_startup.options|=MAIL_OPT_RELAY_TX;
        !           259:     else
        !           260:            MainForm->mail_startup.options&=~MAIL_OPT_RELAY_TX;
        !           261:     MainForm->mail_startup.options&=~(MAIL_OPT_RELAY_AUTH_MASK);
        !           262:     if(RelayAuthLoginRadioButton->Checked==true)
        !           263:         MainForm->mail_startup.options|=MAIL_OPT_RELAY_AUTH_LOGIN;
        !           264:     else if(RelayAuthPlainRadioButton->Checked==true)
        !           265:         MainForm->mail_startup.options|=MAIL_OPT_RELAY_AUTH_PLAIN;
        !           266:     else if(RelayAuthCramMD5RadioButton->Checked==true)
        !           267:         MainForm->mail_startup.options|=MAIL_OPT_RELAY_AUTH_CRAM_MD5;
        !           268:        if(DebugTXCheckBox->Checked==true)
        !           269:        MainForm->mail_startup.options|=MAIL_OPT_DEBUG_TX;
        !           270:     else
        !           271:            MainForm->mail_startup.options&=~MAIL_OPT_DEBUG_TX;
        !           272:        if(DebugRXCheckBox->Checked==true)
        !           273:        MainForm->mail_startup.options|=MAIL_OPT_DEBUG_RX_RSP;
        !           274:     else
        !           275:            MainForm->mail_startup.options&=~MAIL_OPT_DEBUG_RX_RSP;
        !           276:        if(NotifyCheckBox->Checked==false)
        !           277:        MainForm->mail_startup.options|=MAIL_OPT_NO_NOTIFY;
        !           278:     else
        !           279:            MainForm->mail_startup.options&=~MAIL_OPT_NO_NOTIFY;
        !           280:        if(DebugHeadersCheckBox->Checked==true)
        !           281:        MainForm->mail_startup.options|=MAIL_OPT_DEBUG_RX_HEADER;
        !           282:     else
        !           283:            MainForm->mail_startup.options&=~MAIL_OPT_DEBUG_RX_HEADER;
        !           284:        if(POP3EnabledCheckBox->Checked==true)
        !           285:        MainForm->mail_startup.options|=MAIL_OPT_ALLOW_POP3;
        !           286:     else
        !           287:            MainForm->mail_startup.options&=~MAIL_OPT_ALLOW_POP3;
        !           288:        if(POP3LogCheckBox->Checked==true)
        !           289:        MainForm->mail_startup.options|=MAIL_OPT_DEBUG_POP3;
        !           290:     else
        !           291:            MainForm->mail_startup.options&=~MAIL_OPT_DEBUG_POP3;
        !           292: #if 0 /* this is a stupid option */
        !           293:        if(UserNumberCheckBox->Checked==true)
        !           294:        MainForm->mail_startup.options|=MAIL_OPT_ALLOW_RX_BY_NUMBER;
        !           295:     else
        !           296:            MainForm->mail_startup.options&=~MAIL_OPT_ALLOW_RX_BY_NUMBER;
        !           297: #endif
        !           298:        if(AllowRelayCheckBox->Checked==true)
        !           299:        MainForm->mail_startup.options|=MAIL_OPT_ALLOW_RELAY;
        !           300:     else
        !           301:            MainForm->mail_startup.options&=~MAIL_OPT_ALLOW_RELAY;
        !           302:        if(AuthViaIpCheckBox->Checked==true)
        !           303:        MainForm->mail_startup.options|=MAIL_OPT_SMTP_AUTH_VIA_IP;
        !           304:     else
        !           305:            MainForm->mail_startup.options&=~MAIL_OPT_SMTP_AUTH_VIA_IP;
        !           306: 
        !           307:     /* DNSBL */
        !           308:        MainForm->mail_startup.options&=
        !           309:        ~(MAIL_OPT_DNSBL_IGNORE|MAIL_OPT_DNSBL_REFUSE|MAIL_OPT_DNSBL_BADUSER);
        !           310:        if(BLIgnoreRadioButton->Checked==true)
        !           311:        MainForm->mail_startup.options|=MAIL_OPT_DNSBL_IGNORE;
        !           312:     else if(BLRefuseRadioButton->Checked==true)
        !           313:        MainForm->mail_startup.options|=MAIL_OPT_DNSBL_REFUSE;
        !           314:     else if(BLBadUserRadioButton->Checked==true)
        !           315:        MainForm->mail_startup.options|=MAIL_OPT_DNSBL_BADUSER;
        !           316:     if(BLDebugCheckBox->Checked==true)
        !           317:        MainForm->mail_startup.options|=MAIL_OPT_DNSBL_DEBUG;
        !           318:     else
        !           319:            MainForm->mail_startup.options&=~MAIL_OPT_DNSBL_DEBUG;
        !           320: 
        !           321:        if(HostnameCheckBox->Checked==false)
        !           322:        MainForm->mail_startup.options|=MAIL_OPT_NO_HOST_LOOKUP;
        !           323:     else
        !           324:            MainForm->mail_startup.options&=~MAIL_OPT_NO_HOST_LOOKUP;
        !           325:        if(TcpDnsCheckBox->Checked==true)
        !           326:        MainForm->mail_startup.options|=MAIL_OPT_USE_TCP_DNS;
        !           327:     else
        !           328:            MainForm->mail_startup.options&=~MAIL_OPT_USE_TCP_DNS;
        !           329:     if(SendMailCheckBox->Checked==false)
        !           330:         MainForm->mail_startup.options|=MAIL_OPT_NO_SENDMAIL;
        !           331:     else
        !           332:         MainForm->mail_startup.options&=~MAIL_OPT_NO_SENDMAIL;
        !           333: 
        !           334:     int i=0;
        !           335:     setBit(&MainForm->mail_startup.options
        !           336:         ,MAIL_OPT_SEND_INTRANSIT
        !           337:         ,AdvancedCheckListBox->Checked[i++]);
        !           338:     setBit(&MainForm->mail_startup.options
        !           339:         ,MAIL_OPT_DEBUG_RX_BODY
        !           340:         ,AdvancedCheckListBox->Checked[i++]);
        !           341:     setBit(&MainForm->mail_startup.options
        !           342:         ,MAIL_OPT_ALLOW_RX_BY_NUMBER
        !           343:         ,AdvancedCheckListBox->Checked[i++]);
        !           344:     setBit(&MainForm->mail_startup.options
        !           345:         ,MAIL_OPT_DNSBL_CHKRECVHDRS
        !           346:         ,AdvancedCheckListBox->Checked[i++]);
        !           347:     setBit(&MainForm->mail_startup.options
        !           348:         ,MAIL_OPT_DNSBL_THROTTLE
        !           349:         ,AdvancedCheckListBox->Checked[i++]);
        !           350: 
        !           351:     MainForm->MailAutoStart=AutoStartCheckBox->Checked;
        !           352:     MainForm->MailLogFile=LogFileCheckBox->Checked;
        !           353: 
        !           354:     MainForm->SaveIniSettings(Sender);
        !           355: }
        !           356: //---------------------------------------------------------------------------
        !           357: 
        !           358: 
        !           359: void __fastcall TMailCfgDlg::POP3SoundButtonClick(TObject *Sender)
        !           360: {
        !           361:        OpenDialog->FileName=POP3SoundEdit->Text;
        !           362:        if(OpenDialog->Execute()==true) {
        !           363:        POP3SoundEdit->Text=OpenDialog->FileName;
        !           364:         sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC);
        !           365:     }
        !           366: }
        !           367: //---------------------------------------------------------------------------
        !           368: 
        !           369: void __fastcall TMailCfgDlg::DNSRadioButtonClick(TObject *Sender)
        !           370: {
        !           371:     bool checked = RelayRadioButton->Checked && SendMailCheckBox->Checked;
        !           372:     RelayTabSheet->TabVisible=checked;
        !           373:     RelayPortEdit->Enabled=checked;
        !           374:     RelayPortLabel->Enabled=checked;
        !           375:     checked = (!RelayRadioButton->Checked) && SendMailCheckBox->Checked;
        !           376:     DNSServerEdit->Enabled=checked;
        !           377:     DNSServerLabel->Enabled=checked;
        !           378:     TcpDnsCheckBox->Enabled=checked;
        !           379: }
        !           380: //---------------------------------------------------------------------------
        !           381: 
        !           382: void __fastcall TMailCfgDlg::POP3EnabledCheckBoxClick(TObject *Sender)
        !           383: {
        !           384:        POP3PortEdit->Enabled=POP3EnabledCheckBox->Checked;
        !           385:     POP3PortLabel->Enabled=POP3EnabledCheckBox->Checked;
        !           386:     POP3SoundEdit->Enabled=POP3EnabledCheckBox->Checked;
        !           387:     POP3SoundLabel->Enabled=POP3EnabledCheckBox->Checked;
        !           388:     POP3SoundButton->Enabled=POP3EnabledCheckBox->Checked;
        !           389:     POP3LogCheckBox->Enabled=POP3EnabledCheckBox->Checked;
        !           390: }
        !           391: //---------------------------------------------------------------------------
        !           392: 
        !           393: 
        !           394: void __fastcall TMailCfgDlg::SendMailCheckBoxClick(TObject *Sender)
        !           395: {
        !           396:     bool checked=SendMailCheckBox->Checked;
        !           397: 
        !           398:     DeliveryAttemptsEdit->Enabled=checked;
        !           399:     DeliveryAttemptsLabel->Enabled=checked;
        !           400:     RescanFreqEdit->Enabled=checked;
        !           401:     RescanFreqLabel->Enabled=checked;
        !           402:     DNSRadioButton->Enabled=checked;
        !           403:     DNSServerEdit->Enabled=checked;
        !           404:     TcpDnsCheckBox->Enabled=checked;
        !           405:     RelayRadioButton->Enabled=checked;
        !           406:     OutboundSoundEdit->Enabled=checked;
        !           407:     OutboundSoundLabel->Enabled=checked;
        !           408:     OutboundSoundButton->Enabled=checked;
        !           409:     DefCharsetLabel->Enabled=checked;
        !           410:     DefCharsetEdit->Enabled=checked;
        !           411: 
        !           412:     DNSRadioButtonClick(Sender);
        !           413: }
        !           414: //---------------------------------------------------------------------------
        !           415: 
        !           416: 
        !           417: void __fastcall TMailCfgDlg::DNSBLRadioButtonClick(TObject *Sender)
        !           418: {
        !           419:        BLSubjectEdit->Enabled=BLTagRadioButton->Checked;
        !           420:        BLHeaderEdit->Enabled=BLTagRadioButton->Checked;
        !           421:     BLSubjectLabel->Enabled=BLTagRadioButton->Checked;
        !           422:        BLHeaderLabel->Enabled=BLTagRadioButton->Checked;
        !           423: }
        !           424: //---------------------------------------------------------------------------
        !           425: 
        !           426: void __fastcall TMailCfgDlg::DNSBLServersButtonClick(TObject *Sender)
        !           427: {
        !           428:        char filename[MAX_PATH+1];
        !           429: 
        !           430:     sprintf(filename,"%sdns_blacklist.cfg",MainForm->cfg.ctrl_dir);
        !           431:        Application->CreateForm(__classid(TTextFileEditForm), &TextFileEditForm);
        !           432:        TextFileEditForm->Filename=AnsiString(filename);
        !           433:     TextFileEditForm->Caption="Services Configuration";
        !           434:        TextFileEditForm->ShowModal();
        !           435:     delete TextFileEditForm;
        !           436: }
        !           437: //---------------------------------------------------------------------------
        !           438: 
        !           439: 
        !           440: void __fastcall TMailCfgDlg::DNSBLExemptionsButtonClick(TObject *Sender)
        !           441: {
        !           442:        char filename[MAX_PATH+1];
        !           443: 
        !           444:     sprintf(filename,"%sdnsbl_exempt.cfg",MainForm->cfg.ctrl_dir);
        !           445:        Application->CreateForm(__classid(TTextFileEditForm), &TextFileEditForm);
        !           446:        TextFileEditForm->Filename=AnsiString(filename);
        !           447:     TextFileEditForm->Caption="Services Configuration";
        !           448:        TextFileEditForm->ShowModal();
        !           449:     delete TextFileEditForm;
        !           450: }
        !           451: //---------------------------------------------------------------------------
        !           452: 
        !           453: void __fastcall TMailCfgDlg::AllowRelayCheckBoxClick(TObject *Sender)
        !           454: {
        !           455:        AuthViaIpCheckBox->Enabled=AllowRelayCheckBox->Checked;
        !           456: }
        !           457: //---------------------------------------------------------------------------
        !           458: 
        !           459: void __fastcall TMailCfgDlg::RelayAuthRadioButtonClick(TObject *Sender)
        !           460: {
        !           461:     bool enabled = !RelayAuthNoneRadioButton->Checked;
        !           462: 
        !           463:     RelayAuthNameEdit->Enabled=enabled;
        !           464:     RelayAuthPassEdit->Enabled=enabled;
        !           465:     RelayAuthNameLabel->Enabled=enabled;
        !           466:     RelayAuthPassLabel->Enabled=enabled;
        !           467: }
        !           468: //---------------------------------------------------------------------------
        !           469: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.