COZYROC IMAP Connection Unable to Delete Emails from Gmail
COZYROC IMAP Connection Unable to Delete Emails from Gmail
Issue
When using the COZYROC IMAP Connection with Gmail:
- Emails can be read successfully
- Emails can be downloaded and opened
- The Delete operation does not work
- Messages remain in the mailbox after package execution
No explicit error may be thrown, but the email is not removed from Gmail.
Cause
This issue typically occurs due to one or both of the following:
- Gmail IMAP settings are not configured correctly for deletion behavior.
- The OAuth token file used by the COZYROC IMAP connection is expired or invalid.
Gmail may allow read access but restrict delete operations if authentication or IMAP settings are not properly configured.
Resolution
Step 1 – Verify Gmail IMAP Settings
- Log in to the Gmail account.
- Go to Settings → See all settings.
- Open the Forwarding and POP/IMAP tab.
Ensure:
- IMAP is Enabled
- IMAP access is properly configured
- Click Save Changes.
Step 2 – Regenerate the OAuth Token File
- Open the COZYROC IMAP Connection Manager in SSIS.
- Re-authenticate the Gmail account.
- Regenerate the OAuth token file.
- Save the new token file.
- Re-run the SSIS package.
After regenerating the token file and verifying IMAP settings, the delete operation should work as expected.