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

Added support for SMTP submission port (e.g. TCP port 587).

parent d3c057e2
No related branches found
No related tags found
No related merge requests found
...@@ -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 2006 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2008 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 *
...@@ -96,12 +96,14 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender) ...@@ -96,12 +96,14 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
LogFileCheckBox->Checked=MainForm->MailLogFile; LogFileCheckBox->Checked=MainForm->MailLogFile;
HostnameCheckBox->Checked HostnameCheckBox->Checked
=!(MainForm->mail_startup.options&MAIL_OPT_NO_HOST_LOOKUP); =!(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); DefCharsetEdit->Text=AnsiString(MainForm->mail_startup.default_charset);
RelayServerEdit->Text=AnsiString(MainForm->mail_startup.relay_server); RelayServerEdit->Text=AnsiString(MainForm->mail_startup.relay_server);
RelayAuthNameEdit->Text=AnsiString(MainForm->mail_startup.relay_user); RelayAuthNameEdit->Text=AnsiString(MainForm->mail_startup.relay_user);
RelayAuthPassEdit->Text=AnsiString(MainForm->mail_startup.relay_pass); RelayAuthPassEdit->Text=AnsiString(MainForm->mail_startup.relay_pass);
SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port); SMTPPortEdit->Text=AnsiString(MainForm->mail_startup.smtp_port);
SubPortEdit->Text=AnsiString(MainForm->mail_startup.submission_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);
if(isalnum(MainForm->mail_startup.dns_server[0])) if(isalnum(MainForm->mail_startup.dns_server[0]))
...@@ -181,6 +183,7 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender) ...@@ -181,6 +183,7 @@ void __fastcall TMailCfgDlg::FormShow(TObject *Sender)
SendMailCheckBoxClick(Sender); SendMailCheckBoxClick(Sender);
AllowRelayCheckBoxClick(Sender); AllowRelayCheckBoxClick(Sender);
RelayAuthRadioButtonClick(Sender); RelayAuthRadioButtonClick(Sender);
UseSubPortCheckBoxClick(Sender);
PageControl->ActivePage=GeneralTabSheet; PageControl->ActivePage=GeneralTabSheet;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -215,9 +218,10 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender) ...@@ -215,9 +218,10 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
} else } else
MainForm->mail_startup.interface_addr=0; MainForm->mail_startup.interface_addr=0;
MainForm->mail_startup.smtp_port=SMTPPortEdit->Text.ToIntDef(25); MainForm->mail_startup.smtp_port=SMTPPortEdit->Text.ToIntDef(IPPORT_SMTP);
MainForm->mail_startup.pop3_port=POP3PortEdit->Text.ToIntDef(110); MainForm->mail_startup.submission_port=SubPortEdit->Text.ToIntDef(IPPORT_SUBMISSION);
MainForm->mail_startup.relay_port=RelayPortEdit->Text.ToIntDef(25); 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_clients=MaxClientsEdit->Text.ToIntDef(10);
MainForm->mail_startup.max_inactivity=MaxInactivityEdit->Text.ToIntDef(120); MainForm->mail_startup.max_inactivity=MaxInactivityEdit->Text.ToIntDef(120);
MainForm->mail_startup.max_recipients=MaxRecipientsEdit->Text.ToIntDef(100); MainForm->mail_startup.max_recipients=MaxRecipientsEdit->Text.ToIntDef(100);
...@@ -303,6 +307,10 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender) ...@@ -303,6 +307,10 @@ void __fastcall TMailCfgDlg::OKBtnClick(TObject *Sender)
MainForm->mail_startup.options|=MAIL_OPT_SMTP_AUTH_VIA_IP; MainForm->mail_startup.options|=MAIL_OPT_SMTP_AUTH_VIA_IP;
else else
MainForm->mail_startup.options&=~MAIL_OPT_SMTP_AUTH_VIA_IP; 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 */ /* DNSBL */
MainForm->mail_startup.options&= MainForm->mail_startup.options&=
...@@ -467,3 +475,12 @@ void __fastcall TMailCfgDlg::RelayAuthRadioButtonClick(TObject *Sender) ...@@ -467,3 +475,12 @@ void __fastcall TMailCfgDlg::RelayAuthRadioButtonClick(TObject *Sender)
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMailCfgDlg::UseSubPortCheckBoxClick(TObject *Sender)
{
bool enabled = UseSubPortCheckBox->Checked;
SubPortLabel->Enabled = enabled;
SubPortEdit->Enabled = enabled;
}
//---------------------------------------------------------------------------
...@@ -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 = SendMailTabSheet ActivePage = SMTPTabSheet
TabIndex = 3 TabIndex = 1
TabOrder = 3 TabOrder = 3
object GeneralTabSheet: TTabSheet object GeneralTabSheet: TTabSheet
Caption = 'General' Caption = 'General'
...@@ -161,7 +161,7 @@ object MailCfgDlg: TMailCfgDlg ...@@ -161,7 +161,7 @@ object MailCfgDlg: TMailCfgDlg
end end
object LogFileCheckBox: TCheckBox object LogFileCheckBox: TCheckBox
Left = 185 Left = 185
Top = 140 Top = 172
Width = 146 Width = 146
Height = 24 Height = 24
Hint = 'Save log entries to a file (in your DATA directory)' Hint = 'Save log entries to a file (in your DATA directory)'
...@@ -193,17 +193,28 @@ object MailCfgDlg: TMailCfgDlg ...@@ -193,17 +193,28 @@ object MailCfgDlg: TMailCfgDlg
ShowHint = True ShowHint = True
TabOrder = 8 TabOrder = 8
end end
object DebugHeadersCheckBox: TCheckBox
Left = 185
Top = 140
Width = 146
Height = 24
Hint = 'Log all received mail headers (for debugging)'
Caption = 'Log RX Headers'
ParentShowHint = False
ShowHint = True
TabOrder = 9
end
end end
object SMTPTabSheet: TTabSheet object SMTPTabSheet: TTabSheet
Caption = 'SMTP' Caption = 'SMTP'
ImageIndex = 1 ImageIndex = 1
object TelnetPortLabel: TLabel object SMTPPortLabel: TLabel
Left = 9 Left = 9
Top = 12 Top = 12
Width = 104 Width = 104
Height = 24 Height = 24
AutoSize = False AutoSize = False
Caption = 'Listening Port' Caption = 'Transfer Port'
end end
object DefaultUserLabel: TLabel object DefaultUserLabel: TLabel
Left = 9 Left = 9
...@@ -214,8 +225,8 @@ object MailCfgDlg: TMailCfgDlg ...@@ -214,8 +225,8 @@ object MailCfgDlg: TMailCfgDlg
Caption = 'Default User' Caption = 'Default User'
end end
object MaxRecipientsLabel: TLabel object MaxRecipientsLabel: TLabel
Left = 9 Left = 193
Top = 44 Top = 76
Width = 104 Width = 104
Height = 24 Height = 24
AutoSize = False AutoSize = False
...@@ -229,6 +240,14 @@ object MailCfgDlg: TMailCfgDlg ...@@ -229,6 +240,14 @@ object MailCfgDlg: TMailCfgDlg
AutoSize = False AutoSize = False
Caption = 'Max Msg Size' Caption = 'Max Msg Size'
end end
object SubPortLabel: TLabel
Left = 9
Top = 44
Width = 104
Height = 24
AutoSize = False
Caption = 'Submission Port'
end
object SMTPPortEdit: TEdit object SMTPPortEdit: TEdit
Left = 113 Left = 113
Top = 12 Top = 12
...@@ -239,28 +258,17 @@ object MailCfgDlg: TMailCfgDlg ...@@ -239,28 +258,17 @@ object MailCfgDlg: TMailCfgDlg
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
end end
object DebugHeadersCheckBox: TCheckBox
Left = 185
Top = 12
Width = 146
Height = 24
Hint = 'Log all received mail headers (for debugging)'
Caption = 'Log Headers'
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object DefaultUserEdit: TEdit object DefaultUserEdit: TEdit
Left = 113 Left = 113
Top = 108 Top = 108
Width = 185 Width = 176
Height = 24 Height = 24
Hint = Hint =
'Mail for unknown users will go into this user'#39's mailbox (e.g. "s' + 'Mail for unknown users will go into this user'#39's mailbox (e.g. "s' +
'ysop")' 'ysop")'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 3 TabOrder = 2
end end
object AllowRelayCheckBox: TCheckBox object AllowRelayCheckBox: TCheckBox
Left = 9 Left = 9
...@@ -271,28 +279,28 @@ object MailCfgDlg: TMailCfgDlg ...@@ -271,28 +279,28 @@ object MailCfgDlg: TMailCfgDlg
Caption = 'Allow Authenticated Users to Relay Mail' Caption = 'Allow Authenticated Users to Relay Mail'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 4 TabOrder = 3
OnClick = AllowRelayCheckBoxClick OnClick = AllowRelayCheckBoxClick
end end
object MaxRecipientsEdit: TEdit object MaxRecipientsEdit: TEdit
Left = 113 Left = 296
Top = 44 Top = 76
Width = 48 Width = 33
Height = 24 Height = 24
Hint = 'Maximum number of recipients for a single message' Hint = 'Maximum number of recipients for a single message'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 2 TabOrder = 1
end end
object MaxMsgSizeEdit: TEdit object MaxMsgSizeEdit: TEdit
Left = 113 Left = 113
Top = 76 Top = 76
Width = 80 Width = 72
Height = 24 Height = 24
Hint = 'Maximum received message size (in bytes)' Hint = 'Maximum received message size (in bytes)'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 5 TabOrder = 4
end end
object AuthViaIpCheckBox: TCheckBox object AuthViaIpCheckBox: TCheckBox
Left = 9 Left = 9
...@@ -305,19 +313,39 @@ object MailCfgDlg: TMailCfgDlg ...@@ -305,19 +313,39 @@ object MailCfgDlg: TMailCfgDlg
Caption = 'Allow Authentication via POP3, Telnet, etc.' Caption = 'Allow Authentication via POP3, Telnet, etc.'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 6 TabOrder = 5
end end
object NotifyCheckBox: TCheckBox object NotifyCheckBox: TCheckBox
Left = 185 Left = 185
Top = 44 Top = 12
Width = 146 Width = 146
Height = 24 Height = 24
Hint = 'Notify local mail recipients of received e-mails' Hint = 'Notify local mail recipients of received e-mails'
Caption = 'Notify Recipients' Caption = 'Notify Recipients'
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 6
end
object SubPortEdit: TEdit
Left = 113
Top = 44
Width = 48
Height = 24
Hint = 'TCP port number for incoming SMTP submissions (default=587)'
ParentShowHint = False
ShowHint = True
TabOrder = 7 TabOrder = 7
end end
object UseSubPortCheckBox: TCheckBox
Left = 185
Top = 44
Width = 144
Height = 17
Hint = 'Enable the SMTP submission port'
Caption = 'Enabled'
TabOrder = 8
OnClick = UseSubPortCheckBoxClick
end
end end
object POP3TabSheet: TTabSheet object POP3TabSheet: TTabSheet
Caption = 'POP3' Caption = 'POP3'
......
...@@ -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 2005 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2008 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 *
...@@ -68,7 +68,7 @@ __published: ...@@ -68,7 +68,7 @@ __published:
TLabel *MaxInactivityLabel; TLabel *MaxInactivityLabel;
TEdit *MaxInactivityEdit; TEdit *MaxInactivityEdit;
TTabSheet *SMTPTabSheet; TTabSheet *SMTPTabSheet;
TLabel *TelnetPortLabel; TLabel *SMTPPortLabel;
TEdit *SMTPPortEdit; TEdit *SMTPPortEdit;
TCheckBox *HostnameCheckBox; TCheckBox *HostnameCheckBox;
TCheckBox *DebugTXCheckBox; TCheckBox *DebugTXCheckBox;
...@@ -87,7 +87,6 @@ __published: ...@@ -87,7 +87,6 @@ __published:
TEdit *DeliveryAttemptsEdit; TEdit *DeliveryAttemptsEdit;
TLabel *RescanFreqLabel; TLabel *RescanFreqLabel;
TEdit *RescanFreqEdit; TEdit *RescanFreqEdit;
TCheckBox *DebugHeadersCheckBox;
TTabSheet *SoundTabSheet; TTabSheet *SoundTabSheet;
TLabel *SMTPSoundLabel; TLabel *SMTPSoundLabel;
TEdit *InboundSoundEdit; TEdit *InboundSoundEdit;
...@@ -144,6 +143,10 @@ __published: ...@@ -144,6 +143,10 @@ __published:
TCheckListBox *AdvancedCheckListBox; TCheckListBox *AdvancedCheckListBox;
TLabel *DefCharsetLabel; TLabel *DefCharsetLabel;
TEdit *DefCharsetEdit; TEdit *DefCharsetEdit;
TLabel *SubPortLabel;
TEdit *SubPortEdit;
TCheckBox *DebugHeadersCheckBox;
TCheckBox *UseSubPortCheckBox;
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);
...@@ -157,6 +160,7 @@ __published: ...@@ -157,6 +160,7 @@ __published:
void __fastcall DNSBLExemptionsButtonClick(TObject *Sender); void __fastcall DNSBLExemptionsButtonClick(TObject *Sender);
void __fastcall AllowRelayCheckBoxClick(TObject *Sender); void __fastcall AllowRelayCheckBoxClick(TObject *Sender);
void __fastcall RelayAuthRadioButtonClick(TObject *Sender); void __fastcall RelayAuthRadioButtonClick(TObject *Sender);
void __fastcall UseSubPortCheckBoxClick(TObject *Sender);
private: private:
public: public:
virtual __fastcall TMailCfgDlg(TComponent* AOwner); virtual __fastcall TMailCfgDlg(TComponent* AOwner);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,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 2007 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
...@@ -179,26 +179,30 @@ int retry_bind(SOCKET s, const struct sockaddr *addr, socklen_t addrlen ...@@ -179,26 +179,30 @@ int retry_bind(SOCKET s, const struct sockaddr *addr, socklen_t addrlen
#endif #endif
#ifndef SHUT_RDWR #ifndef SHUT_RDWR
#define SHUT_RDWR 2 /* for shutdown() */ #define SHUT_RDWR 2 /* for shutdown() */
#endif #endif
#ifndef IPPORT_HTTP #ifndef IPPORT_HTTP
#define IPPORT_HTTP 80 #define IPPORT_HTTP 80
#endif #endif
#ifndef IPPORT_FTP #ifndef IPPORT_FTP
#define IPPORT_FTP 21 #define IPPORT_FTP 21
#endif #endif
#ifndef IPPORT_TELNET #ifndef IPPORT_TELNET
#define IPPORT_TELNET 23 #define IPPORT_TELNET 23
#endif #endif
#ifndef IPPORT_SMTP #ifndef IPPORT_SMTP
#define IPPORT_SMTP 25 #define IPPORT_SMTP 25
#endif #endif
#ifndef IPPORT_POP3 #ifndef IPPORT_POP3
#define IPPORT_POP3 110 #define IPPORT_POP3 110
#endif #endif
#ifndef IPPORT_IDENT #ifndef IPPORT_IDENT
#define IPPORT_IDENT 113 #define IPPORT_IDENT 113
#endif #endif
#ifndef IPPORT_SUBMISSION
#define IPPORT_SUBMISSION 587
#endif
#endif /* Don't add anything after this line */ #endif /* Don't add anything after this line */
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