[ot][spam][crazy] log: imap script to manage removals? was: hobby chart of removal requests
import imap_tools with imap_tools.MailBox('host').login('email', 'pwd') as mailbox: for msg in mailbox.fetch(criteria):
i have interest in reading about IDLE which lets one get server side pushes regarding new email. https://datatracker.ietf.org/doc/html/rfc2177 . i'm just not sure how to implement a client such that emails aren't dropped within race conditions.
it looks like if there are any race conditions, they can be sorted out using uid and message sequence numbers. in imap_tools, the MailMessage class wraps a class from a package called "email". quote from MailMessage's constructor: self.obj = email.message_from_bytes(raw_message_data)
email message objects are likely https://docs.python.org/3/library/email.message.html in the cpython source, it looked like the serializing and deserializing this class with bytes is partially but not fully tested for idempotency. it appeared the deserialization tests disabled unix_from and only deserialized using a StringIO object, not including non-utf8 byte content. i did not review the tests to the very end.
participants (1)
-
Undiscussed Horrific Abuse, One Victim of Many