Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

61 lines
1.9 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. function trim(s)
  15. return (s:gsub("^%s*(.-)%s*$", "%1"))
  16. end
  17. -- Gets password from pass
  18. status, dom_password = pipe_from('pass show Email/privateemail.com/yigit@yigitcolakoglu.com')
  19. domain = IMAP {
  20. server = "mail.privateemail.com",
  21. port = 143,
  22. username = "yigit@yigitcolakoglu.com",
  23. password = trim(dom_password ),
  24. ssl = auto
  25. }
  26. -- Gets password from pass
  27. status, hot_password = pipe_from('pass show AppPass/microsoft.com/yigitcolakoglu@hotmail.com')
  28. -- Setup an imap account called hotmail
  29. hotmail = IMAP {
  30. server = "outlook.office365.com",
  31. port = 143,
  32. username = "yigitcolakoglu@hotmail.com",
  33. password = trim(hot_password),
  34. ssl = auto
  35. }
  36. -- Block fucking Aleksandr. LEAVE ME ALONE DUDE
  37. function fuckAleksandr()
  38. mailboxes, folders = domain:list_all("/")
  39. for _, v in pairs(mailboxes) do
  40. messages = domain[v]:contain_subject("Предложение")
  41. messages:delete_messages()
  42. end
  43. end
  44. -- Block annoying university advertisement e-mails
  45. function blockUni(blacklist)
  46. mailboxes, folders = domain:list_all("/")
  47. for _, v in pairs(mailboxes) do
  48. for _, u in pairs(blacklist) do
  49. messages = domain[v]:contain_body(u)
  50. messages:delete_messages()
  51. end
  52. end
  53. end
  54. fuckAleksandr {}
  55. blockUni {"Hult", "hult"}