-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support Lua 5.4 for configuration files
This commit enables the use of Lua (version 5.4) for configuration files, providing greater flexibility and customization options for users.
- Loading branch information
1 parent
fe73b11
commit 0edae3e
Showing
13 changed files
with
325 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
set -eux | ||
apt-get update -q | ||
apt-get install -y libnotmuch-dev liblua5.4-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,19 @@ nfpms: | |
maintainer: Michael Adler <[email protected]> | ||
homepage: https://github.com/michaeladler/notmuch-mailmover | ||
description: move notmuch tagged mails into Maildir folders | ||
dependencies: | ||
- notmuch | ||
overrides: | ||
deb: | ||
dependencies: | ||
- libnotmuch5 | ||
- liblua5.4-0 | ||
rpm: | ||
dependencies: | ||
- lua | ||
- notmuch | ||
archlinux: | ||
dependencies: | ||
- notmuch-runtime | ||
- lua | ||
section: mail | ||
priority: extra | ||
contents: | ||
|
@@ -67,9 +78,9 @@ nfpms: | |
- src: share/notmuch-mailmover.1.gz | ||
dst: /usr/share/man/man1/notmuch-mailmover.1.gz | ||
|
||
# example config | ||
- src: example/config.yaml | ||
dst: /usr/share/doc/notmuch-mailmover/config.yaml | ||
# example configurations | ||
- src: example/ | ||
dst: /usr/share/doc/notmuch-mailmover/ | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- anything goes here, as long as it returns a table (which can be parsed into the corresponding `config::Config` struct) | ||
|
||
--- @enum config.match_mode | ||
--- Match modes for rules. | ||
local match_modes = { | ||
ALL = "all", | ||
FIRST = "first", | ||
UNIQUE = "unique", | ||
} | ||
|
||
--- Configuration for notmuch-mailmover. | ||
-- | ||
--- @class config | ||
--- @field maildir string Path to the maildir | ||
--- @field notmuch_config string Path to the notmuch configuration | ||
--- @field rename boolean Rename the files when moving | ||
--- @field max_age_days number Maximum age (days) of the messages to be procssed | ||
--- @field rule_match_mode config.match_mode Match mode for rules | ||
--- @field rules rule[] List of rules | ||
--- | ||
--- @class rule | ||
--- @field folder string Folder to move the messages to | ||
--- @field query string Notmuch query to match the messages | ||
local config = { | ||
maildir = os.getenv("HOME") .. "/mail", | ||
notmuch_config = "~/.config/notmuch/notmuchrc", | ||
rename = false, | ||
max_age_days = 60, | ||
rule_match_mode = match_modes.FIRST, | ||
rules = { | ||
{ | ||
folder = "Trash", | ||
query = "tag:trash", | ||
}, | ||
{ | ||
folder = "Spam", | ||
query = "tag:spam", | ||
}, | ||
{ | ||
folder = "Sent", | ||
query = "tag:sent", | ||
}, | ||
{ | ||
folder = "Archive", | ||
query = "tag:archive", | ||
}, | ||
{ | ||
folder = "INBOX", | ||
query = "tag:inbox", | ||
}, | ||
}, | ||
} | ||
|
||
return config |
Oops, something went wrong.