-
Notifications
You must be signed in to change notification settings - Fork 10
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
Moving emails forth and back to the Sent folder updates emails date (needs confirmation) #5
Comments
I updated title and explanation above so the description is more accurate |
I have a question: Is the Sent folder part of the same EWS mailbox, or is it inside Local Folders? What I'd be interested is whether you are moving the item between two mailboxes or just within one mailbox. |
It was between two mailboxes, in particular between EWS mailbox and Local Folders |
Then this explains a few things. When moving items between mailboxes the item is effectively deleted from one mailbox and created from scratch in the other. When creating e-mail items on EWS the current implementation just sends the full MIME message and expects that the Exchange server parses it and extracts all the necessary information, including the date. It seems that this is not done correctly. The fact that this works when using IMAP proves that the Exchange server is capable of parsing it correctly. I'll test this in my environment and I'll try to come up with a workaround. |
I have tried this myself and indeed the behaviour is a bit strange. After having moved an e-mail from the EWS "Sent Items" to the Local Folder's "Sent Items" and back I haven't seen any issues in KMail. However when I looked at the Sent Items folder from OWA I have noticed that the e-mail was now at the top of the list with the current date. Strangely though when I opened it up in OWA, the original date was displayed in the header. Are the above symptoms matching your experience? |
I think this is definitely the same issue, although when I tried it, the issue was also visible in kmail. The current version of kmail has changed quite a bit, so it may be that this is not visible in kmail anymore. Right now I'm using disconnected imap as this is a production email, but I plan to come back to EWS once it becomes a bit more mature. Thanks for the good work! |
The "Sent Items" folder is a little "special" when it comes to creating items. Unlike other folders when creating items there the creation date/time is always set to the current date/time instead of the value from the MIME Date header. This causes mail that was copied from other folders to appear with the current date/time instead of the original one. To work around this create the item in the "Drafts" folder first and then move it to "Sent Items". Fixes bug #5.
I have studied the case further and it looks like the "Sent Items" folder is a little special when it comes to creating items using EWS. Normally when creating new items (this includes copying items from other mailboxes) the item date is extracted from the MIME "Date" attribute of the supplied MIME message. In case of the "Sent Items" folder the date is always set to the current date/time. This is why you were seeing this strange behaviour. I didn't find any explicit way to tell Exchange to use a specific date/time for the new item added into the "Sent Items" folder so I had to get away with a workaround. In case an item is to be created in the "Sent Items" folder it is first temporarily created in another folder (I've initially picked the "Drafts" folder) and then moved to the "Sent Items" folder using a MoveItem request. This way the date is set correctly when creating the item and is preserved when moving the item internally within the Exchange mailbox. |
I recently realized that when moving a Sent email forth to another folder and then back again to the Sent folder, its date (let's say an email sent 2 weeks ago) is replaced by the date of the day in which the email is moved (let's say today).
This behavior occurs with my "Sent" emails, and the only way to fix this issue was to connect via imap and move forth and back all Sent emails, so the original date was restablished.
Could you please test whether this is a general issue? I am not 100% sure if this is related to akonadi-ews or to the Exchange/Office365 server itself (I recently migrated from Exchange to Office 365).
Also, I am not sure if this behavior happens also for folders other than Sent. I didn't experience such an issue with other folders, but I'm not sure if I moved emails from other folders. I would prefer not to test this myself as this is a production email, and now everything seems back to normal.
The text was updated successfully, but these errors were encountered: