Skip to content

fix(email-connector): fix for inbound email connector when an email cant be moved #4640

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

Conversation

mathias-vandaele
Copy link
Collaborator

Description

Some IMAP servers do not permit folder creation:

  • Infomaniak allows it.
  • Gmail does not.

When the folder did not exist on Gmail, the scheduler malfunctioned due to an exception being thrown. To prevent this issue, we now mark the email as 'read' before attempting to move it, ensuring that it is not processed again, thereby improving the system's efficiency.

If an exception occurs because the folder could not be created, and we are reading only unseen emails, the connector is canceled with a RetryException. If we are reading all emails, the connector is canceled with a ConnectorException.

Related issues

closes #4367

Checklist

  • PR has a milestone or the no milestone label.

@mathias-vandaele mathias-vandaele requested a review from a team as a code owner April 23, 2025 15:05
@mathias-vandaele mathias-vandaele linked an issue Apr 23, 2025 that may be closed by this pull request
@mathias-vandaele mathias-vandaele self-assigned this Apr 23, 2025
@mathias-vandaele mathias-vandaele added this to the 8.8.0-alpha4 milestone Apr 23, 2025
@mathias-vandaele mathias-vandaele changed the title bug(email-connector): fix for inbound email connector when an email cant be moved fix(email-connector): fix for inbound email connector when an email cant be moved Apr 23, 2025
@mathias-vandaele mathias-vandaele force-pushed the 4367-inbound-email-connector-fixing-the-identified-issues branch from c274706 to adcd922 Compare April 23, 2025 15:08
@sbuettner
Copy link
Contributor

@mathias-vandaele What about avoiding this issue by requiring the folder to be present when starting the Connector?

@mathias-vandaele
Copy link
Collaborator Author

@mathias-vandaele What about avoiding this issue by requiring the folder to be present when starting the Connector?

@sbuettner I'm not sure about this, it doesn't seem right to remove a feature just because one email provider doesn't allow folder creation at the root level.

It should still be possible to create folders in Gmail if we prefix them with [Gmail], rather than trying to create them directly at the root.

@sbuettner
Copy link
Contributor

sbuettner commented Apr 25, 2025

I am concerned that this feature is not working properly but if you think it’s worth it we can keep it.

@mathias-vandaele Please make sure this is properly documented in our docs for this operation.

@mathias-vandaele mathias-vandaele added this pull request to the merge queue Apr 25, 2025
Merged via the queue into main with commit a6ab770 Apr 25, 2025
14 checks passed
@mathias-vandaele mathias-vandaele deleted the 4367-inbound-email-connector-fixing-the-identified-issues branch April 25, 2025 11:22
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.

[Inbound Email connector] Fixing the identified issues
2 participants