Download Gmail attachments
Automatically download Gmail attachments on mail.google.com. Download every attachment of a Gmail thread, given its thread id as returned by search_emails, and save the files to your computer under their real names. Returns the thread id, how many files were saved, and each file's name and path. Attachments from every message in the thread are included, and inline images count as attachments.
Input
threadId requiredHex legacy thread id.
account optionalGoogle account email to act as (authuser=). Without it Gmail picks u/0, nondeterministic in a multi-account browser jar.
Output
n requiredfiles requiredthreadId requiredFAQ
Search Gmail
Search the signed-in Gmail with the native query syntax (from:, to:, subject:, has:attachment, after:/before:, labels…) and return matching threads: threadId (feed it to get_thread / reply_to_email), sender, senderEmail, subject, snippet, date, unread, starred, hasAttachment. Results are threads rather than individual messages, which is Gmail's own search granularity, and only the first page of results is returned (up to 50).
Send Gmail email
Send an email from the signed-in Gmail account, with a plain-text body and an optional single file attachment.
Forward Gmail thread
Forward an entire Gmail thread to one recipient, with an optional leading note. Takes the hex threadId that search_emails returns, and forwards the whole conversation inline rather than a single message. Returns forwarded, threadId and to. The thread must be on the first page of All Mail, newest-first, so older conversations cannot be reached this way.
