Skip to content
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

Console options for days instead of timestamp #91

Open
silviuchingaru opened this issue Dec 28, 2021 · 1 comment
Open

Console options for days instead of timestamp #91

silviuchingaru opened this issue Dec 28, 2021 · 1 comment

Comments

@silviuchingaru
Copy link
Contributor

Because RefreshMailboxCommand::refreshMailbox() uses imap_search() with 'SINCE "' . $timestamp->format('d F Y') . '"' which is 'SINCE "28 December 2021"', for example, so as not to mislead users that only message from one hour ago are fetched when using -t 60, instead of timestamp option we could use a days option for uvdesk:refresh-mailbox command.

So instead of running something like
php bin/console uvdesk:refresh-mailbox -t 2 [email protected]

they could run something like
php bin/console uvdesk:refresh-mailbox -d 1 [email protected]
to fetch emails since yesterday until now
or
php bin/console uvdesk:refresh-mailbox -d 0 [email protected]
to fetch only emails of curent day.

If you agree with this enhachment, i could post a pull request with this implementation.

@silviuchingaru
Copy link
Contributor Author

silviuchingaru commented Apr 15, 2022

For better approach for performance reasons on large mailboxes will be to use imap_search($stream, 'UID ' . $latest_uid . ':*', SE_UID);.

@see https://stackoverflow.com/questions/32698415/php-imap-search-unseen-since-date-with-time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant