2020-09-18 10:25:49 +00:00
|
|
|
function sendToFolder(folderFrom, folderTo, senders)
|
2020-09-17 17:49:53 +00:00
|
|
|
for _, sender in pairs(senders) do
|
2020-09-18 10:25:49 +00:00
|
|
|
messages = folderFrom:contain_from(sender)
|
2020-09-17 17:49:53 +00:00
|
|
|
messages:mark_seen()
|
2020-09-18 10:25:49 +00:00
|
|
|
messages:move_messages(folderTo)
|
2020-09-17 17:49:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-09-18 15:10:19 +00:00
|
|
|
function getSenderList(file)
|
|
|
|
local rollupSenders={}
|
|
|
|
|
|
|
|
local file = io.open(file)
|
|
|
|
if file then
|
|
|
|
for line in file:lines() do
|
|
|
|
table.insert(rollupSenders, line)
|
|
|
|
end
|
|
|
|
else
|
|
|
|
print("ERROR: rollup did not find rollup.txt file containing mail addresses.")
|
|
|
|
end
|
|
|
|
return rollupSenders
|
2020-09-17 17:49:53 +00:00
|
|
|
end
|
2020-09-18 15:10:19 +00:00
|
|
|
|
|
|
|
sendToFolder (
|
|
|
|
accounts.gmail["Inbox"],
|
|
|
|
accounts.gmail["Dump"],
|
|
|
|
getSenderList(getConfigDir() .. "/rollup.txt")
|
|
|
|
)
|