My Dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.3 KiB

  1. -- According to the IMAP specification, when trying to write a message
  2. -- to a non-existent mailbox, the server must send a hint to the client,
  3. -- whether it should create the mailbox and try again or not. However
  4. -- some IMAP servers don't follow the specification and don't send the
  5. -- correct response code to the client. By enabling this option the
  6. -- client tries to create the mailbox, despite of the server's response.
  7. -- This variable takes a boolean as a value. Default is “false”.
  8. options.create = true
  9. -- By enabling this option new mailboxes that were automatically created,
  10. -- get auto subscribed
  11. options.subscribe = true
  12. -- How long to wait for servers response.
  13. options.timeout = 120
  14. -- The directory for all my imapfilder files
  15. imapfilterdir= os.getenv("HOME") .. '/.config/imapfilter/'
  16. function split (inputstr, sep)
  17. if sep == nil then
  18. sep = "%s"
  19. end
  20. local t={}
  21. for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  22. table.insert(t, str)
  23. end
  24. return t
  25. end
  26. -- This function takes a table of email addresses and flags messages from them in the inbox.
  27. function flagSenders(senders)
  28. for _, v in pairs(senders) do
  29. messages = work["Inbox"]:contain_from(v)
  30. messages:mark_flagged()
  31. end
  32. end
  33. -- Load my work-account credentials and work specific rules
  34. loadfile(imapfilterdir .. "work-account.lua.secret")()