From d0e90531c6c352d6dbaeeded3a18dac812fe3477 Mon Sep 17 00:00:00 2001 From: KF7EEL Date: Mon, 1 Mar 2021 16:50:55 -0800 Subject: [PATCH] fix mailbox parsing --- bridge_gps_data.py | 2 +- gps_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge_gps_data.py b/bridge_gps_data.py index d906527..92e5a4d 100755 --- a/bridge_gps_data.py +++ b/bridge_gps_data.py @@ -309,7 +309,7 @@ def process_sms(_rf_src, sms): os.remove('/tmp/gps_data_user_sos.txt') logger.info('Removing SOS') elif '@' and 'M-' in sms: - message = re.sub('@.* |M-','',sms) + message = re.sub('^@|.* M-|','',sms) recipient = re.sub('@| M-.*','',sms) mailbox_write(get_alias(int_id(_rf_src), subscriber_ids), int_id(_rf_src), time.strftime('%H:%M:%S - %m/%d/%y'), message, str(recipient).upper()) elif '@REM MAIL' == sms: diff --git a/gps_data.py b/gps_data.py index 2cbdd9d..81e0883 100644 --- a/gps_data.py +++ b/gps_data.py @@ -300,7 +300,7 @@ def process_sms(_rf_src, sms): os.remove('/tmp/gps_data_user_sos.txt') logger.info('Removing SOS or Notice') elif '@' and 'M-' in sms: - message = re.sub('@.* |M-','',sms) + message = re.sub('^@|.* M-|','',sms) recipient = re.sub('@| M-.*','',sms) mailbox_write(get_alias(int_id(_rf_src), subscriber_ids), int_id(_rf_src), time.strftime('%H:%M:%S - %m/%d/%y'), message, str(recipient).upper()) elif '@REM MAIL' == sms: