Created
April 23, 2024 07:56
-
-
Save sburlot/076a570e533bfbf1219581b4dd11eaf6 to your computer and use it in GitHub Desktop.
Mark snoozed emails from FastMail as UNREAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# When snoozing a Fastmail ( fastmail.com ) message, mark it as unread so when it appears | |
# again in the INBOX it's unread and I can see it, instead of being another | |
# email lost in all my messages | |
# run it as an hourly cron | |
# tested with Python 3.10.12 | |
# | |
# Stephan Burlot [email protected] Apr 2024 | |
# | |
from imap_tools import MailBox, MailMessageFlags, AND | |
mailbox = MailBox('imap.fastmail.com') | |
mailbox.login('LOGIN_NAME', 'SECRETPASSWORD', 'Snoozed') | |
mailbox.flag(mailbox.uids(AND(seen=True)), MailMessageFlags.SEEN, False) | |
mailbox.logout() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment