New Mails are not changed to 'unread' after start of YAM

fixed a bug where 'new' mail was never changed to 'unread' status if it was moved to a subfolder. Now the index of all folders carrying 'new' mail will be loaded and the status adapted accordingly.

Description

If a newly received mail is moved to another folder (by hand or by (spam)filter), it will not be marked as 'unread' after the next start of YAM but will still have the status 'new': Only if the mail is in the incoming folder it will marked as unread (check mark 'mark new mail as unread at start' is set).
I have tested this behavior under MorphOS with V2.8 and nightly build.

Repeating these steps still correctly results in one "unread" message in the spam folder for me, even if it was "new" before.

Please provide a FOLDER debug log created with the next nightly build of YAM 2.9-dev. Details about how to create this log can be found in the FAQ.

I just forgot to tell, please also provide the subject of the "new" mail as the debug log will list the subject of the mails of which the status is changed while starting up YAM.

Here is what I did:
I unpacked YAM29dev to RAM: started it once to change Look&Feel:Main window/Show embedded read pane in main window. Then I closed YAM, deleted .index in the incoming folder, copied the file of mail 'keine Neue Mail' into the incoming folder and the file of mail 'Neue Mail' into the spam folder, entered the command setenv yamdebug folder,@all,stdout and then started YAM with yam.debug DEBUG >T:debug.log
Then I enabled the view of unread and new mails and saw 1 unread but no new mail in both the incoming and the spam folder. After clicking onto the spam folder, I saw 1 unread and new mail. Finally I closed YAM.

I unpacked YAM29dev to RAM: started it once to change Look&Feel:Main window/Show embedded read pane in main window. Then I closed YAM, deleted .index in the incoming folder, copied the file of mail 'keine Neue Mail' into the incoming folder and the file of mail 'Neue Mail' into the spam folder, entered the command setenv yamdebug folder,@all,stdout and then started YAM with yam.debug DEBUG >T:debug.log
Then I enabled the view of unread and new mails and saw 1 unread but no new mail in both the incoming and the spam folder. After clicking onto the spam folder, I saw 1 unread and new mail. Finally I closed YAM.

Now I finally understand what is going wrong here, and what is not. Let me explain.

The startup option "mark new mails as unread" can only be applied to folders for which the index is loaded during the startup phase. By default the option to load the index of all folders is inactive to save time and memory. Thus YAM will skip the "mark new mails as unread" for all folders except the current one, which will be the incoming folder by default. Hence its index will always be loaded and new mails in the incoming folder will become unread. This is something which had to be changed in YAM 2.8, because 2.8 will flush the folder's index from time to time to save memory for seldom accessed folder with lots of mails. And reloading a formerly flushed index should not remove the "new" state of mails. This is why YAM 2.7 behaves differently here.

To solve this issue we now have two possibilities:

enable the "load all folders" option on the Startup/Quit page of the configuration

enable the "load all folders" option in the default configuration and make the "mark new mails as unread" a suboption of this, as this feature depends on the former one to work as expected in all cases. Furthermore both options should be enabled in the default configuration.

Solution 1 is versy easy to archive even without having to change anything in YAM, except the configuration.

But on the long sight solution 2 seems to be more logical to me. Jens what do you think?

(In [6520]) * YAM.c, YAM_MAf.c: when having the option active that new mail will be changed

to unread upon restarting YAM, all mails of folders known to carry new mail
(upon checking the index meta data) will now be changed to unread by forcing
a full index load via MA_GetIndex(). This partly addresses and refs #367.

Jens' latest change fixes this issue, at least all my tests resulted in the correct behaviour. Please try yourself with the next nightly build and reopen this ticket if you still think there is something wrong.

Please note, "next nighlty build" always denotes the binary built in the next upcoming night, which is usually on the next day (tomorrow) around 2:00 CET in the morning. I am just mentioning this fact, because your debug log was done before the next nightly build was released.

Add Comment

This ticket has been modified since you started editing. You should review the
other modifications which have been appended above,
and any conflicts shown in the preview below.
You can nevertheless proceed and submit your changes if you wish so.