name = "imap"
description = "IMAP mail, such as Proton Mail through Bridge: read, search and save attachments"
version = "1.2.1"
requires = "/usr/bin/python3"
stdin = "mail/imap"
[[tool]]
name = "recent"
description = "Most recent messages: id, date, sender, subject"
params = ["count?", "mailbox?"]
limits = { count = { max = 50 }, mailbox = { max_len = 100 } }
run = ["/usr/bin/python3", "-I", "-c", "imap.py", "recent", "{count}", "{mailbox}"]
[[tool]]
name = "search"
description = "Search messages for text in headers or body, newest 50"
params = ["query", "mailbox?"]
limits = { query = { max_len = 200 }, mailbox = { max_len = 100 } }
run = ["/usr/bin/python3", "-I", "-c", "imap.py", "search", "{query}", "{mailbox}"]
[[tool]]
name = "read"
description = "Headers, attachment names and the text body of one message, by id"
params = ["id", "mailbox?"]
limits = { id = { digits = true }, mailbox = { max_len = 100 } }
run = ["/usr/bin/python3", "-I", "-c", "imap.py", "read", "{id}", "{mailbox}"]
[[tool]]
name = "attachments"
description = "The attachments of one message, by id, as JSON with name, type, size and base64"
params = ["id", "mailbox?"]
limits = { id = { digits = true }, mailbox = { max_len = 100 } }
run = ["/usr/bin/python3", "-I", "-c", "imap.py", "attachments", "{id}", "{mailbox}"]