Log actual listen address
[mgsmtp.git] / MgSMTP.pas
index 1cee11968ec66ea4e05e193e5620f9e3193102da..1627479c1b590e297992f1b9cc437d57652db626 100644 (file)
@@ -1,6 +1,6 @@
 {
    MegaBrutal's SMTP Server (MgSMTP)
-   Copyright (C) 2010-2016 MegaBrutal
+   Copyright (C) 2010-2018 MegaBrutal
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
@@ -49,7 +49,7 @@ const
      document what bugfix/feature are you testing with the actual build.
      This will be logged to help you differentiate outputs of subsequent
      builds in your logs. If left empty, it won't be added to the logs. }
-   DEVCOMMENT  =  'Catch CTRL-C in user mode';
+   DEVCOMMENT  =  'Log actual listen address if hostname given';
 
 var
 
@@ -179,13 +179,18 @@ begin
             SpoolManager:=     TSpoolManager.Create(Config);
             PolicyManager:=    TPolicyManager.Create(Config);
 
+            AddDevComment(Logger);
+
+            if (Config.ReadString('Server', 'ListenAddress', '') = '')
+            and (Config.ReadString('Server', 'ListenPort', '') <> '') then
+               Logger.AddStdLine('WARNING! Server\ListenPort is deprecated. Use ListenAddress instead!');
+
             if Config.ReadBool('Spool', 'KeepProcessedEnvelopes', false)
             or Config.ReadBool('Spool', 'KeepProcessedEMails', false) then
                if not DirectoryExists('processed') then CreateDir('processed');
 
             Config.Free;
 
-            AddDevComment(Logger);
             Logger.AddStdLine('Primary server name: ' + MainServerConfig.Name);
             Logger.AddStdLine('FCrDNS policy: ' + FCrDNSPolicyToStr(PolicyManager.FCrDNSPolicy));
             if MailboxManager.DomainSpecific then
@@ -231,7 +236,7 @@ begin
          end
          else begin
             Config.Free;
-            Out.writeln('Error: Server/Name is a mandatory configuration entry.'#13#10
+            Out.writeln('Error: Server\Name is a mandatory configuration entry.'#13#10
                + 'Please configure the application properly, refer to the manual.');
             ReportSvcStatus(SERVICE_STOPPED, 2, 0);
          end;
@@ -246,7 +251,7 @@ end;
 
 begin
    Out.writeln('MegaBrutal''s SMTP Server, version ' + VERSION_STR + ', ' + IntToStr(PLATFORM_BITS) + ' bits');
-   Out.writeln('Copyright (C) 2010-2014 MegaBrutal');
+   Out.writeln('Copyright (C) 2010-2018 MegaBrutal');
    AddDevComment(Out);
    Out.writeln;