mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 02:09:04 +02:00
chore: modify mailmover to stop breaking sent folder
This commit is contained in:
parent
ce6e0f69af
commit
b5fdf4a7c5
1 changed files with 10 additions and 0 deletions
|
@ -32,6 +32,11 @@ local function is_parent_path(parent, child)
|
||||||
return child:match("^" .. parent .. "/") ~= nil
|
return child:match("^" .. parent .. "/") ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Check if a folder contains "Archive" in its name
|
||||||
|
local function contains_archive(folder)
|
||||||
|
return string.find(folder, "Archive") ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
--- Generate rules based on folder structure
|
--- Generate rules based on folder structure
|
||||||
local function generate_rules(maildir_path)
|
local function generate_rules(maildir_path)
|
||||||
local folders = get_maildir_folders(maildir_path)
|
local folders = get_maildir_folders(maildir_path)
|
||||||
|
@ -98,6 +103,11 @@ local function generate_rules(maildir_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add "not tag:sent" for any folder containing "Archive"
|
||||||
|
if contains_archive(folder) then
|
||||||
|
table.insert(exclusion_parts, "not tag:sent")
|
||||||
|
end
|
||||||
|
|
||||||
-- Build the complete query
|
-- Build the complete query
|
||||||
local query = table.concat(query_parts, " and ")
|
local query = table.concat(query_parts, " and ")
|
||||||
if #exclusion_parts > 0 then
|
if #exclusion_parts > 0 then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue