diff options
author | Question Box Service <qbox@andrewyu.org> | 2023-04-07 10:20:47 +0200 |
---|---|---|
committer | Question Box Service <qbox@andrewyu.org> | 2023-04-07 10:20:47 +0200 |
commit | 958e0840142d113b50c30119f387b363403b45fe (patch) | |
tree | da6ea3cef8fe9224e573257a96f5284eb5ab3b0a | |
parent | 75de78518235d3cab6e875e44839b1e81787a897 (diff) | |
download | qbox-958e0840142d113b50c30119f387b363403b45fe.tar.gz qbox-958e0840142d113b50c30119f387b363403b45fe.zip |
Fix flushing and new->cur
-rwxr-xr-x | app.py | 8 | ||||
-rw-r--r-- | todo | 4 |
2 files changed, 8 insertions, 4 deletions
@@ -143,10 +143,16 @@ def qboard(user): # Why not in a separate email_stuff() function? # Because lazy mbox = mailbox.Maildir('/home/qbox/Mail/Inbox') - for msg in mbox: + for msg_id, msg in mbox.items(): if msg.get_subdir() != "new": continue + print(f'{msg.get_subdir()=}') + mbox.lock() + msg.add_flag("SR") msg.set_subdir("cur") # apparently it's not doing so + print(f'{msg.get_subdir()=} should be cur') + mbox[msg_id] = msg mbox.flush() + mbox.unlock() parsed_address = parse_address(msg["From"]) from_address = parsed_address[1] + "@" + parsed_address[2] if from_address != MAPPING[user][0]: continue @@ -1,3 +1 @@ -- user list in seperate configuration file - - {username: (database_file, email_address)} - - Read email replies from maildir in seperate user +fix new -> cur |