Skip to content

9.0 mail cleanup - #410

Merged
lasley merged 12 commits into
OCA:9.0from
mdietrichc2c:9.0-mail-cleanup
Oct 10, 2016
Merged

lasley merged 12 commits into
OCA:9.0from
mdietrichc2c:9.0-mail-cleanup

Conversation

@mdietrichc2c

Copy link
Copy Markdown
Contributor

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

Comment thread mail_cleanup/README.rst Outdated
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**>`_.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/7.0/9.0

@yvaucher

yvaucher commented Apr 7, 2016

Copy link
Copy Markdown
Member

Only some nitpicking in the README.rst otherwise 👍

@mdietrichc2c

Copy link
Copy Markdown
Contributor Author

Thanks for the review ; I corrected those.

@yvaucher

Copy link
Copy Markdown
Member

Travis is not happy:

File "/home/travis/build/OCA/server-tools/mail_cleanup/__init__.py", line 1, in <module>
from . import models
ImportError: cannot import name models

@coveralls

coveralls commented Apr 26, 2016

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-6.1%) to 58.128% when pulling 9c7ab1f on mdietrichc2c:9.0-mail-cleanup into 30f9109 on OCA:9.0.

@mdietrichc2c

Copy link
Copy Markdown
Contributor Author

@yvaucher sorry, missing a file ; it's now fixed.

@lasley lasley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission @mdietrichc2c - comments inline

Comment thread mail_cleanup/models/mail_cleanup.py Outdated
for field in ['cleanup_days', 'purge_days', 'cleanup_folder']:
fetchmail[field] = config_vals[field]

cleanup_days = fields.Integer(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field definitions should be above methods

Comment thread mail_cleanup/models/mail_cleanup.py Outdated
fetchmail[field] = config_vals[field]

cleanup_days = fields.Integer(
compute=_get_cleanup_conf,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',

Comment thread mail_cleanup/models/mail_cleanup.py Outdated
help="Number of days before marking an e-mail as read")

cleanup_folder = fields.Char(
compute=_get_cleanup_conf,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',

Comment thread mail_cleanup/models/mail_cleanup.py Outdated
help="Folder where an e-mail marked as read will be moved.")

purge_days = fields.Integer(
compute=_get_cleanup_conf,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use string for computation declarations in order to allow inherited changes: compute='_get_cleanup_conf',

Comment thread mail_cleanup/models/mail_cleanup.py Outdated

def _cleanup_fetchmail_server(self, server, imap_server):
count, failed = 0, 0
expiration_date = fields.Date.from_string(fields.Date.today())

@lasley lasley Oct 5, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime.date.today() would be a lot more efficient

Comment thread mail_cleanup/models/mail_cleanup.py Outdated
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())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime.date.today() would be a lot more efficient

@mdietrichc2c

Copy link
Copy Markdown
Contributor Author

@lasley changes done

@lasley lasley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @mdietrichc2c

@lasley
lasley merged commit 1c7cc1c into OCA:9.0 Oct 10, 2016
jcoux pushed a commit to jcoux/server-tools that referenced this pull request Sep 14, 2020
* 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
jcoux pushed a commit to jcoux/server-tools that referenced this pull request Oct 26, 2020
* 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
sonhd91 pushed a commit to sonhd91/server-tools that referenced this pull request Dec 27, 2021
* 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
sonhd91 pushed a commit to sonhd91/server-tools that referenced this pull request Dec 8, 2022
* 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
Ricardoalso pushed a commit to camptocamp/server-tools that referenced this pull request Sep 19, 2023
* 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
ntsirintanis pushed a commit to Therp/server-tools that referenced this pull request Oct 8, 2024
* 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
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-tools (10.0)
Ricardoalso pushed a commit to Ricardoalso/server-tools that referenced this pull request Jan 15, 2025
* 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
Ricardoalso pushed a commit to Ricardoalso/server-tools that referenced this pull request Jan 15, 2025
* 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
omalbastin pushed a commit to omalbastin/server-tools that referenced this pull request May 7, 2025
* 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
dnplkndll pushed a commit to ledoent/server-tools that referenced this pull request May 27, 2026
* 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
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

Successfully merging this pull request may close these issues.

5 participants