server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[16.0][FIX] fetch...folder: use message uid's not sequence

Open NL66278 opened this issue 1 year ago • 1 comments

When archiving messages, the messages get a new sequence through renumbering. To solve the problems this causes use the message uid's that are garanteed to remain constant for a message within a folder.

NL66278 avatar Aug 22 '24 14:08 NL66278

@zamberjo Can you have a look at this?

NL66278 avatar Aug 22 '24 19:08 NL66278

As highlighted in PR #3222, the reverse processing of emails aims to address a similar issue to the one you're working on here.

But I fail to see the exact modification you are doing in this PR to retreive UID instead of sequences. It's probably lost in all the variable renames.

ikus060 avatar Mar 07 '25 17:03 ikus060

@ikus060 I introduce the variable name message_uid instead of msgid, because it is a really different thing. msgid is basically the position of the message in the imap folder, and gets updated all the time because of insertions and deletions. message_uid however is constant (as long as the message remains in the same folder). However to work with the uid's the methods to work with messages are replaced by a single method on the connection, uid, with the original methodname as the first parameter: connection.uid("search", charset, criteria) connection.uid("fetch", message_uid, "(RFC822)") ... Working with the message_uid's is intrinsically more reliable...

NL66278 avatar Mar 07 '25 17:03 NL66278

ok, I see connection.uid("search", charset, criteria) vs connection.search(None, criteria)

I've missed that while looking at the changes. Thanks for pointing the changes.

ikus060 avatar Mar 07 '25 18:03 ikus060

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot avatar Apr 29 '25 10:04 OCA-git-bot

/ocabot merge minor

NL66278 avatar May 01 '25 08:05 NL66278

On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-3017-by-NL66278-bump-minor, awaiting test results.

OCA-git-bot avatar May 01 '25 08:05 OCA-git-bot

Congratulations, your PR was merged at 141d0a25b3cea648c4b8f207aa444b81c33fb3a8. Thanks a lot for contributing to OCA. ❤️

OCA-git-bot avatar May 01 '25 08:05 OCA-git-bot