9.0 mail cleanup - #410
9.0 mail cleanup#410
Conversation
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us smashing it by providing a detailed and welcomed feedback | ||
| `here <https://github.com/OCA/server-tools/issues/new?body=module:%20mail_cleanup%0Aversion:%207.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|
Only some nitpicking in the README.rst otherwise 👍 |
|
Thanks for the review ; I corrected those. |
|
Travis is not happy: |
|
@yvaucher sorry, missing a file ; it's now fixed. |
Fix error with multi mail servers
lasley
left a comment
There was a problem hiding this comment.
Thanks for the submission @mdietrichc2c - comments inline
| for field in ['cleanup_days', 'purge_days', 'cleanup_folder']: | ||
| fetchmail[field] = config_vals[field] | ||
|
|
||
| cleanup_days = fields.Integer( |
There was a problem hiding this comment.
Field definitions should be above methods
| fetchmail[field] = config_vals[field] | ||
|
|
||
| cleanup_days = fields.Integer( | ||
| compute=_get_cleanup_conf, |
There was a problem hiding this comment.
Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',
| help="Number of days before marking an e-mail as read") | ||
|
|
||
| cleanup_folder = fields.Char( | ||
| compute=_get_cleanup_conf, |
There was a problem hiding this comment.
Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',
| help="Folder where an e-mail marked as read will be moved.") | ||
|
|
||
| purge_days = fields.Integer( | ||
| compute=_get_cleanup_conf, |
There was a problem hiding this comment.
Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',
|
|
||
| def _cleanup_fetchmail_server(self, server, imap_server): | ||
| count, failed = 0, 0 | ||
| expiration_date = fields.Date.from_string(fields.Date.today()) |
There was a problem hiding this comment.
datetime.date.today() would be a lot more efficient
| def _purge_fetchmail_server(self, server, imap_server): | ||
| # Purging e-mails older than the purge date, if available | ||
| count, failed = 0, 0 | ||
| purge_date = fields.Date.from_string(fields.Date.today()) |
There was a problem hiding this comment.
datetime.date.today() would be a lot more efficient
|
@lasley changes done |
lasley
left a comment
There was a problem hiding this comment.
LGTM thanks @mdietrichc2c
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
Syncing from upstream OCA/server-tools (10.0)
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
* Add new module "mail_cleanup" in order to move/mark as read old messages * Use correct Model + remove unnecessary conditions/assignments * Add purging mechanism + cleanup is by default inactive * Add new field + new info in README * Correct type for purge_days + better checks * Place expunge() call after parsing all messages * Migration to 9.0 of mail_cleanup * Fix README.rst * Add __init__.py * Fix error with multi mail servers * Correct syntax for methods + use datetime.date.today
Migration to 9.0 of the module
mail_cleanup, which existed only in 7.0 : https://github.com/OCA/server-tools/tree/7.0/mail_cleanup