-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use IMAP uid to retrieve new mails instead of "NOT SEEN" flag #36
Conversation
(cherry picked from commit bdadb46)
This commit introduces new configuration options: * `uid_tracking` - set to `true` to use IMAP uid instead of "NOT SEEN" flag * `sincedb_path` - path to file with last processed IMAP uid. Defaults to `#{path.data}/plugins/input/imap/.sincedb_#{Digest::MD5.hexdigest("#{@user}_#{@host}_#{@PORT}_#{@folder}")}` IMAP uid is always stored in the file `sincedb_path` regardles of the `uid_tracking` setting, so we can switch between "NOT SEEN" and "UID" tracking. In transition from the previous plugin version, we first need to process at least one mail with `uid_tracking` set to `false` to save the last processed IMAP uid and then switch `uid_tracking` to `true`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prehor Thanks for the contribution - this looks like a good addition to the plugin.
I have some minor requests, nothing too serious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I will merge and publish this change shortly. Thanks for the contribution!
Wait a minute please, a little improvement is on the way. |
Hi @robbavey, I'm done. Could you please review the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good - @karenzone would you mind giving the docs a quick review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc builds cleanly and LGTM. Thanks for taking time to update the docs with good descriptions, @prehor
@prehor Let me know if you are good with these changes being merged, and I will go ahead and merge and publish the gem. Thanks again for the contribution! |
I think that it is finished. Today I downloaded approximately 10.000 emails from Gmail and plugin was working well. |
This commit introduces new configuration options: * `uid_tracking` - set to `true` to use IMAP uid instead of "NOT SEEN" flag * `sincedb_path` - path to file with last processed IMAP uid. Defaults to `#{path.data}/plugins/input/imap/.sincedb_#{Digest::MD5.hexdigest("#{@user}_#{@host}_#{@PORT}_#{@folder}")}` IMAP uid is always stored in the file `sincedb_path` regardles of the `uid_tracking` setting, so we can switch between "NOT SEEN" and "UID" tracking. In transition from the previous plugin version, we first need to process at least one mail with `uid_tracking` set to `false` to save the last processed IMAP uid and then switch `uid_tracking` to `true`. Fixes #36
@prehor Thanks for the pointer - I've just assigned it to myself to review and will take a look at it shortly. Thanks again! |
This PR introduces the following configuration options:
uid_tracking
- set totrue
to use IMAP uid instead of "NOT SEEN" flag. defaults tofalse
sincedb_path
- path to file with last processed IMAP uid. Defaults to<path.data>/plugins/inputs/imap
IMAP uid is always stored in the file
sincedb_path
regardles of theuid_tracking
setting, so you can switch between "NOT SEEN" and "UID" tracking. In transition from the previous plugin version, first process at least one mail withuid_tracking
set tofalse
to save the last processed IMAP uid and then switchuid_tracking
totrue
.Fixies #31