- Plesk for Linux
After restoring a domain from a backup via Plesk > Tools & Settings > Backup Manager, email messages show backup restoration date and time as the time they were received on the Apple mail client.
Other mail clients and webmail show the correct date and time when the email messages were received.
Apple mail client uses the timestamp from the mail message file on the filesystem as a reference. At the same time, the actual date when a message was delivered is stored in the email headers. For more details check Apple thread here.
During the backup restoration process in Plesk, timestamps of files are reset to the current date. This behavior is caused by a bug with ID #PPPM-10282, which will be fixed in future Plesk updates.
Connect to the server via SSH.
Download this script to fix the email files timestamp by running the command below:
# wget https://support.plesk.com/hc/en-us/article_attachments/4407730641426/PMT-4559_mtime_update.sh
Give execution permission to the downloaded script file:
# chmod +x PMT-4559_mtime_update.sh
Run the script with the target mailbox name:
# ./PMT-4559_mtime_update.sh email@example.com
Or multiple mailboxes:
# ./PMT-4559_mtime_update.sh firstname.lastname@example.org email@example.com
After the script execution is finished, log out and log in back to the mail client and check timestamps.
In some cases, Dovecot indexes might also need to be rebuilt. For this, dovecot index files for each affected mail account should be moved from the default directory.
Note: It should be done separately for each affected account. In the example below, index files are moved for the account jdoe existing for the domain example.com (firstname.lastname@example.org):
Create the destination directory for the index files to be moved:
# mkdir -p /root/indexback/jdoe
Move the Dovecot index files:
# mv /var/qmail/mailnames/example.com/jdoe/Maildir/dovecot.index* /root/indexback/jdoe/
Log out and log in back to the mail client.