8000 [16.0] Fetchmail_server_folder - fail with imaplib.IMAP4.abort: command: FETCH => System Error · Issue #3213 · OCA/server-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[16.0] Fetchmail_server_folder - fail with imaplib.IMAP4.abort: command: FETCH => System Error #3213

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

Open
ikus060 opened this issue Feb 28, 2025 · 4 comments
Labels

Comments

@ikus060
Copy link
ikus060 commented Feb 28, 2025

Module

Fetchmail_server_folder

Describe the bug

Only starting to test the module and it's fail trying to retrive email from a GMail server.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Enable the module
  2. Configure the folders to be fetch
  3. Click on "FETCH FOLDER NOW" buttont

Image

Expected behavior
The module should fetch and process the mails.

Current behaviour

2025-02-28 19:02:17,438 1 ERROR ikus odoo.addons.fetchmail_attach_from_folder.models.fetchmail_server_folder: Failed to fetch mail b'1' from server GMail Patrik 
Traceback (most recent call last):
  File "/usr/lib/python3.9/imaplib.py", line 1047, in _command_complete
    typ, data = self._get_tagged_response(tag, expect_bye=logout)
  File "/usr/lib/python3.9/imaplib.py", line 1165, in _get_tagged_response
    self._check_bye()
  File "/usr/lib/python3.9/imaplib.py", line 961, in _check_bye
    raise self.abort(bye[-1].decode(self._encoding, 'replace'))
imaplib.IMAP4.abort: System Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 188, in retrieve_imap_folder
    self.apply_matching(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 227, in apply_matching
    message_org = self.fetch_msg(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 269, in fetch_msg
    result, msgdata = connection.fetch(msgid, "(RFC822)")
  File "/usr/lib/python3.9/imaplib.py", line 548, in fetch
    typ, dat = self._simple_command(name, message_set, message_parts)
  File "/usr/lib/python3.9/imaplib.py", line 1230, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python3.9/imaplib.py", line 1049, in _command_complete
    raise self.abort('command: %s => %s' % (name, val))
imaplib.IMAP4.abort: command: FETCH => System Error
2025-02-28 19:02:17,445 1 ERROR ikus odoo.addons.fetchmail_attach_from_folder.models.fetchmail_server_folder: Failed to fetch mail b'2' from server GMail Patrik 
Traceback (most recent call last):
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 188, in retrieve_imap_folder
    self.apply_matching(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 227, in apply_matching
    message_org = self.fetch_msg(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 269, in fetch_msg
    result, msgdata = connection.fetch(msgid, "(RFC822)")
  File "/usr/lib/python3.9/imaplib.py", line 548, in fetch
    typ, dat = self._simple_command(name, message_set, message_parts)
  File "/usr/lib/python3.9/imaplib.py", line 1230, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python3.9/imaplib.py", line 1045, in _command_complete
    self._check_bye()
  File "/usr/lib/python3.9/imaplib.py", line 961, in _check_bye
    raise self.abort(bye[-1].decode(self._encoding, 'replace'))
imaplib.IMAP4.abort: System Error
2025-02-28 19:02:17,445 1 ERROR ikus odoo.addons.fetchmail_attach_from_folder.models.fetchmail_server_folder: Failed to fetch mail b'3' from server GMail Patrik 
Traceback (most recent call last):
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 188, in retrieve_imap_folder
    self.apply_matching(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 227, in apply_matching
    message_org = self.fetch_msg(connection, msgid)
  File "/mnt/extra-addons/fetchmail_attach_from_folder/models/fetchmail_server_folder.py", line 269, in fetch_msg
    result, msgdata = connection.fetch(msgid, "(RFC822)")
  File "/usr/lib/python3.9/imaplib.py", line 548, in fetch
    typ, dat = self._simple_command(name, message_set, message_parts)
  File "/usr/lib/python3.9/imaplib.py", line 1230, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python3.9/imaplib.py", line 1045, in _command_complete
    self._check_bye()
  File "/usr/lib/python3.9/imaplib.py", line 961, in _check_bye
    raise self.abort(bye[-1].decode(self._encoding, 'replace'))
imaplib.IMAP4.abort: System Error

Additional context

@ikus060 ikus060 added the bug label Feb 28, 2025
@ikus060
Copy link
Author
ikus060 commented Feb 28, 2025

Never mind,

Suddently, I can't reproduce the problem.

Sorry for the noise

@ikus060 ikus060 closed this as completed Feb 28, 2025
@ikus060
Copy link
Author
ikus060 commented Mar 1, 2025

Finnaly the problem started again.

I notice the issue arise when defining an "archive" folder option. Since the expunge is execute on every delete operation and not at the very end. The message id return by the fetch doesn't make any sens.

I would recommand to modify the implementation to either:

  1. Process the message ids from last to first.
  2. Execute expunge at the end

@ikus060 ikus060 reopened this Mar 1, 2025
@NL66278
Copy link
Contributor
NL66278 commented May 1, 2025

Solved in this commit: 17ba6bc

@ikus060
Copy link
Author
ikus060 commented May 1, 2025

Thank you !

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

No branches or pull requests

2 participants
0