mirror of
https://github.com/craigerl/aprsd.git
synced 2024-12-20 08:31:11 -05:00
Allow email to be disabled.
The config file defaults to email being off now. This requires the user to set the email settings anyway, so the default is off.
This commit is contained in:
parent
a656508ba6
commit
982f24c5f5
@ -417,12 +417,17 @@ def server(
|
||||
setup_logging(config, loglevel, quiet)
|
||||
LOG.info("APRSD Started version: {}".format(aprsd.__version__))
|
||||
|
||||
email_enabled = config["aprsd"]["email"].get("enabled", False)
|
||||
|
||||
if email_enabled:
|
||||
# TODO(walt): Make email processing/checking optional?
|
||||
# Maybe someone only wants this to process messages with plugins only.
|
||||
valid = email.validate_email_config(config, disable_validation)
|
||||
if not valid:
|
||||
LOG.error("Failed to validate email config options")
|
||||
sys.exit(-1)
|
||||
else:
|
||||
LOG.info("Email services not enabled.")
|
||||
|
||||
# Create the initial PM singleton and Register plugins
|
||||
plugin_manager = plugin.PluginManager(config)
|
||||
@ -448,8 +453,11 @@ def server(
|
||||
|
||||
rx_thread = threads.APRSDRXThread(msg_queues=msg_queues, config=config)
|
||||
tx_thread = threads.APRSDTXThread(msg_queues=msg_queues, config=config)
|
||||
|
||||
if email_enabled:
|
||||
email_thread = email.APRSDEmailThread(msg_queues=msg_queues, config=config)
|
||||
email_thread.start()
|
||||
|
||||
rx_thread.start()
|
||||
tx_thread.start()
|
||||
|
||||
|
@ -21,6 +21,9 @@ class EmailPlugin(plugin.APRSDPluginBase):
|
||||
def command(self, fromcall, message, ack):
|
||||
LOG.info("Email COMMAND")
|
||||
reply = None
|
||||
if not self.config["aprsd"]["email"].get("enabled", False):
|
||||
LOG.debug("Email is not enabled in config file ignoring.")
|
||||
return "Email not enabled."
|
||||
|
||||
searchstring = "^" + self.config["ham"]["callsign"] + ".*"
|
||||
# only I can do email
|
||||
|
Loading…
Reference in New Issue
Block a user