ok that was too harsh.. just default to port 25 if not config found

This commit is contained in:
Chris 2019-08-16 13:34:00 +02:00
parent f84f30376d
commit de259612a8

View file

@ -119,15 +119,18 @@ if __name__ == '__main__':
logger.addHandler(ch)
if not os.path.isfile("../config.ini"):
print "[ERR] Config.ini not found. Rename example.config.ini to config.ini before starting the server :)"
sys.exit()
print "[ERR] Config.ini not found. Rename example.config.ini to config.ini. Defaulting to port 25"
port = 25
else :
Config = ConfigParser.ConfigParser()
Config.read("../config.ini")
port = int(Config.get("MAILSERVER","PORT"))
Config = ConfigParser.ConfigParser()
Config.read("../config.ini")
print "[i] Starting Mailserver on port",int(Config.get("MAILSERVER","PORT"))
print "[i] Starting Mailserver on port",port
server = CustomSMTPServer(('0.0.0.0', int(Config.get("MAILSERVER","PORT"))), None) # use your public IP here
server = CustomSMTPServer(('0.0.0.0', port), None) # use your public IP here
print "[i] Ready to receive Emails"
print ""
asyncore.loop()