Commit Graph

23 Commits

Author SHA1 Message Date
Hemna e175f77347 Use Gray instead of Black for code formatting.
The Black code formatter sucks with respect to function
declarations with a lot of params.  Completely unreadable.
2021-08-23 13:32:09 -04:00
Hemna 9ba44a076c Removed some noisy debug log.
Use the tracing instead to enable the debugging of
email calls
2021-02-10 10:37:39 -05:00
Hemna 131919bdfb Wrap another server call with try except
Dreamhost email is total garbage.  Stop using it.
2021-02-05 15:32:36 -05:00
Hemna a5cc274ff5 Wrap all imap calls with try except blocks
The Email Thread has been unstable due to some IMAP servers
being crap.  This patch wraps more of the imap server calls
in try except blocks to try and trap errors.
2021-02-03 11:00:20 -05:00
Craig Lamparter 47135c6086 EmailThread was exiting because of IMAP timeout, added exceptions for this 2021-02-02 11:13:17 -08:00
Hemna db2b537317 Added memory tracing in keeplive 2021-01-29 11:02:21 -05:00
Hemna af48c43eb2 Added tracing facility
You can enable debug tracing iff loglevel == DEBUG AND
config file has aprsd:trace:True
2021-01-29 10:07:49 -05:00
Hemna 94bad95e26 Fixed email login issue.
This patch undoes an overzealous reworking of the
config.  the arps login didn't move.
2021-01-26 13:33:39 -05:00
Hemna 030b02551f Enable debug logging for smtp and imap
Add the new config options for
aprsd:
  email:
    imap:
      debug: True

    smtp:
      debug: True
2021-01-25 16:16:08 -05:00
Craig Lamparter cfb172481d more debug around email thread 2021-01-25 12:54:24 -08:00
Craig Lamparter 3ca0eeff56 debug around EmailThread hanging or vanishing 2021-01-25 12:24:20 -08:00
Hemna c1e6792721 Fixed resend email after config rework
This patch fixes 1 missed access to the shortcuts after
the restructuring of the config file
2021-01-25 15:15:53 -05:00
Hemna 5c949343ec Added Flask web thread and stats collection
This patch adds the stats object to collect statistics of
the running server.  This also optionally adds the ability
to run a flask web service on a port to use as a keepalive
healthcheck.
2021-01-21 20:58:47 -05:00
Hemna ce5b09233c Reworked the config file and options
This patch reorganizes the config file layout and options
to make more logical sense as well as make it more readable.

This breaks backwards compatibility.
2021-01-21 13:32:19 -05:00
Hemna d81bfd6fd5 Enabled some emailthread messages and added timestamp
This patch re-enables some log.debug messages for email, to ensure
we can see emailthread is running correctly.  Also adds a timestamp
to the query pending messages, so radios don't think it's a duplicate
message.
2021-01-15 11:12:43 -05:00
Craig Lamparter 7e3b95fd01 get rid of some debug noise from tracker and email delay 2021-01-14 10:51:00 -08:00
Hemna e6dee3a5b0 Disable MX record validation
This patch disables the MX record checking for
email address shortcuts.  verizon is a shit
smtp host that won't let you check emails as
existing/valid.  Email validation still is checked
against RFC based regex for email address as
well as blacklist checking.

TODO(hemna): make this optionally enabled
by config file.
2021-01-10 13:22:23 -05:00
Hemna 231c15b1af Lots of fixes 2021-01-08 20:58:18 -05:00
Hemna 4c0150dd97 Added more pre-commit hook tests
also added pre-commit job for tox.
2021-01-08 20:57:58 -05:00
Hemna 9f4cc27a11 Fixed email shortcut lookup
This patch fixes the email.get_email_from_shortcut.  It ensures that
if the lookup isn't found in the shortcut list, it simply returns
the original value.  This patch also adds a unit test to specifically
test this function to always return the correct value.
2021-01-08 19:35:16 -05:00
Hemna 2e90c0bdbb Creation of MsgTrack object and other stuff
This patch adds the new MsgTrack object replacing the
global ack_dict.  the ack_dict was not thread safe.
the new MsgTrack is a singleton object that keeps track of
all outbound TextMessage objects.  When a TextMessage.send() is called
it is added to the MsgTrack object, and when an ack is received for that
message, the message is removed from the MsgTrack object.

TODO:  Add an automatic mechanism for saving the messages in MsgTrack
so that when CTRL-C is called to exit aprsd server, then the MsgTrack
state is saved to storage.   When aprsd server is started up again, add
the option to try and reload state of MsgTrack.

This patch also reworked the email thread into an APRSDThread object
that can exit gracefully with CTRL-C.

NOTE: Don't call sleep() with a long time (greater than 5 seconds), as
it causes a delay in exiting aprsd until the last sleep() finishes.
Since aprsd has so many threads now for processing incoming messages and
outgoing messages, we need to coordinate all thread operations so that
they don't block the exiting of the app.
2020-12-29 10:40:38 -05:00
Hemna fa51f8fdf2 Big patch
This commit adds the new send-message command for sending messages.
This also redoes the logging of sent/rx'd packets to a single method
which is syncrhonized, so we don't get intermixed log messages for
packets.

Also adds email address validation during startup, and
optionally disables the validation via a command line switch.  without
email validation for production running aprsd, emails sent can turn up
garbage and cause issues when those emails are received by aprsd
message processing as invalid content.
2020-12-19 16:35:53 -05:00
Hemna 08c73a17d1 Major refactor
This branch refactors the majority of main.py out into individual
modules to compartmentalize the code.  Migrated all email related
features unti email.py, sending of messages into messaging.py

Also refactored all of the socket code to use aprslib for all APRS-IS
communication as well as message/packet processing.

Moved the email command into it's own Plugin.
2020-12-18 16:21:35 -05:00