Skip to content

Instantly share code, notes, and snippets.

@jogerj
Created September 23, 2025 19:52
Show Gist options
  • Save jogerj/1069e4189f05f5c2a3cadb4f2b0bec10 to your computer and use it in GitHub Desktop.
Save jogerj/1069e4189f05f5c2a3cadb4f2b0bec10 to your computer and use it in GitHub Desktop.
Files incoming messages into subfolders of Inbox by YYYY-MM
require ["date", "fileinto", "variables"];
if date :matches "date" "year" "*" {
set "year" "${1}";
}
if date :matches "date" "month" "*" {
if string :matches "${1}" "?" {
set "month" "0${1}";
} else {
set "month" "${1}";
}
}
fileinto "INBOX.${year}-${month}";
stop;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment