Guest User

Untitled

a guest
Mar 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. -- General settings, these were there...
  2. options.timeout = 120
  3. options.subscribe = true
  4.  
  5. -- Configure imap account FROM which new messages are taken
  6. account1 = IMAP {
  7.     server = 'imap.domain1.com',
  8.     username = 'username1',
  9.     password = 'password1',
  10.     ssl = 'ssl3',
  11. }
  12.  
  13. -- Configure imap account TO receive new messages
  14. account2 = IMAP {
  15.     server = 'imap.domain2.com',
  16.     username = 'username2',
  17.     password = 'password2',
  18.     ssl = 'ssl3',
  19. }
  20.  
  21. -- Fetches all unread messages from account1
  22. results = account1.INBOX:is_unseen()
  23.  
  24. -- First copy messages under a TAG that I want them under, filter e.g. a Gmail is not always sufficient
  25. results:copy_messages(account2['Folder/Tag'])
  26. -- Copy message to inbox
  27. results:copy_messages(account2.INBOX)
  28.  
  29. -- Mark messages as seen so that they are not copied multiple times
  30. results:mark_seen()
Add Comment
Please, Sign In to add comment