MKP 1.1.3 bugfix for handling usagae calculation if quota not set (mailboxes)

This commit is contained in:
Ralf Mellis 2023-09-22 15:57:46 +02:00
parent d55380d647
commit a9a97701e0
2 changed files with 8 additions and 4 deletions

View File

@ -93,12 +93,16 @@ def parse_mailcow_mailboxes_section(string_table):
display_name = line[4]
# number of messages within mailbox
number_of_messages = int(line[5])
# percent in use, rounded to full percent
percent_in_use = int(line[6])
# calculate storage used for all messages in mailbox
quota = int(line[7])
total_number_of_bytes_used = int(line[8])
percent_storage_used_for_messages = total_number_of_bytes_used * 100 / quota
if quota == 0:
# quota is not set, if this is the case, line[6] contains no numeric value, but the char "-"
percent_in_use = 0
else:
total_number_of_bytes_used = int(line[8])
percent_storage_used_for_messages = total_number_of_bytes_used * 100 / quota
# percent in use, rounded to full percent
percent_in_use = int(line[6])
# get time of last login for IMAP/POP3/SMTP (seconds since epoch)
last_imap_login = int(line[9])
last_pop3_login = int(line[10])

BIN
mkp/Mailcow-1.1.3.mkp Executable file

Binary file not shown.