-
-
Save djgrasss/1982302a26d07344fb41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Simple script to fetch IMAP data from iCloud | |
| # Set ICLOUD_EMAIL and ICLOUD_PASSWORD to environment variables | |
| require 'net/imap' | |
| require 'active_support' | |
| imap = Net::IMAP.new('imap.mail.me.com', 993, true) | |
| imap.login(ENV['ICLOUD_EMAIL'], ENV['ICLOUD_PASSWORD']) | |
| imap.select 'INBOX' | |
| uids = imap.uid_search(['SINCE', 1.week.ago.strftime('%d-%b-%Y')]) | |
| fetch_datas = imap.uid_fetch(uids, ['RFC822', 'RFC822.HEADER']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment