Fixed imap_append() from clearing all flags on messages and avoid purge_user() from purging the wrong Visit records.
imap_misc.c: imap_append() was trying to append the flags after the room had been restored to the original room, so all flags in the room were being cleared. Moved imap_do_append_flags() before the room was changed back.
user_ops.c: purge_user() was assuming that the first part of the key for Visit records was the user number. Actually is the room number so was removing records where the room and user numbers matched. A solution is to go through all the Visit records and delete, but not worth it. Auto-Purge will clean up the records later. Future: When expanded IMAP flagging is added, we will move the user number to the top of the key and reactivate the existing method.
ctdl3264_prep.sh: Build fix to support ‘tail’ command version differences for + option. CentOS/Rocky Linux needs -n option added for command not to error. Now tests command and sets the proper option to work.