diff --git a/front/pluginsCore.php b/front/pluginsCore.php index 344fc8fe..cdd7277a 100755 --- a/front/pluginsCore.php +++ b/front/pluginsCore.php @@ -127,13 +127,19 @@ function processColumnValue(dbColumnDef, value, index, type) { value = `${value}`; break; case 'threshold': + + valueTmp = '' + $.each(dbColumnDef.options, function(index, obj) { - if(Number(value) < obj.maximum && value == '') + if(Number(value) < obj.maximum && valueTmp == '') { - value = `
${value}
` + valueTmp = `
${value}
` // return; } }); + + value = valueTmp; + break; case 'replace': $.each(dbColumnDef.options, function(index, obj) { diff --git a/pialert/publishers/email.py b/pialert/publishers/email.py index be045463..c957d006 100755 --- a/pialert/publishers/email.py +++ b/pialert/publishers/email.py @@ -42,6 +42,9 @@ def send (msg: noti_struc): # Send mail failedAt = print_log('Trying to open connection to ' + str(conf.SMTP_SERVER) + ':' + str(conf.SMTP_PORT)) + # Set a timeout for the SMTP connection (in seconds) + smtp_timeout = 30 + if conf.SMTP_FORCE_SSL: failedAt = print_log('SMTP_FORCE_SSL == True so using .SMTP_SSL()') if conf.SMTP_PORT == 0: @@ -49,7 +52,7 @@ def send (msg: noti_struc): smtp_connection = smtplib.SMTP_SSL(conf.SMTP_SERVER) else: failedAt = print_log('SMTP_PORT == 0 so sending .SMTP_SSL(SMTP_SERVER, SMTP_PORT)') - smtp_connection = smtplib.SMTP_SSL(conf.SMTP_SERVER, conf.SMTP_PORT) + smtp_connection = smtplib.SMTP_SSL(conf.SMTP_SERVER, conf.SMTP_PORT, timeout=smtp_timeout) else: failedAt = print_log('SMTP_FORCE_SSL == False so using .SMTP()')