From Kromonos, 1 Year ago, written in Plain Text.
Embed
  1. require ["imap4flags", "fileinto", "regex", "subaddress", "vacation", "envelope", "variables", "mailbox"];
  2.  
  3. if envelope :matches :detail "to" "*" {
  4.     set :lower :upperfirst "tag" "${1}";
  5. }
  6.  
  7. if string :is "${tag}" "" {
  8.     /* Nothing to do! */
  9. } else {
  10.     fileinto :create "INBOX.Tagged.${tag}";
  11. }