MKP 1.1.4, bugfix for the last bugfix :-)

This commit is contained in:
Ralf Mellis 2023-09-22 16:19:53 +02:00
parent a9a97701e0
commit 8df903c8f6
2 changed files with 6 additions and 3 deletions

View File

@ -95,14 +95,17 @@ def parse_mailcow_mailboxes_section(string_table):
number_of_messages = int(line[5]) number_of_messages = int(line[5])
# calculate storage used for all messages in mailbox # calculate storage used for all messages in mailbox
quota = int(line[7]) quota = int(line[7])
total_number_of_bytes_used = int(line[8])
if quota == 0: if quota == 0:
# quota is not set, if this is the case, line[6] contains no numeric value, but the char "-" # quota is not set, if this is the case, line[6] contains no numeric value, but the char "-"
# so set all usage counters to zero
percent_in_use = 0 percent_in_use = 0
percent_storage_used_for_messages = 0
else: else:
total_number_of_bytes_used = int(line[8]) # percent in use, rounded to full percent (calculated by Mailcow)
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]) percent_in_use = int(line[6])
# let's calculate our own value
percent_storage_used_for_messages = total_number_of_bytes_used * 100 / quota
# get time of last login for IMAP/POP3/SMTP (seconds since epoch) # get time of last login for IMAP/POP3/SMTP (seconds since epoch)
last_imap_login = int(line[9]) last_imap_login = int(line[9])
last_pop3_login = int(line[10]) last_pop3_login = int(line[10])

BIN
mkp/Mailcow-1.1.4.mkp Executable file

Binary file not shown.