imapfilter might be the tool you need:
https://github.com/lefcha/imapfilter

I use it to move and expire mailing lists like so:

for i,mbox in ipairs(mailboxes) do
    print("Moving messages older than ".. move_older .." days in ".. mbox .." 
to Trash.")
    messages = account1[mbox]:is_older(move_older)
    messages:move_messages(account1['Trash'])
end

For your needs you would use arrived_before instead of is_older.

On Thu, 7 Jan 2021 09:32:37 -0500
Daniel Barrett <[email protected]> wrote:

> Has anyone done any scripting to manipulate email on a remote IMAP
> server? I'd like to select about 50,000 emails from an Inbox of
> ~80,000 (say, all emails from 2020) and move them to a different
> folder on the same IMAP server. I'm wondering if fetchmail or similar
> tools can do this (but am open to other suggestions).

-- 
Rich Pieri
_______________________________________________
Discuss mailing list
[email protected]
http://lists.blu.org/mailman/listinfo/discuss

Reply via email to