Messages imported through Mail Importing are displayed with incorrect date in Apple Mail




  • Avatar
    Peter Hansen (Edited )

    There seems some bugs... 


    1) the timestamp-change-script does not work on all mail files...

    here is an example:

    grep -m1 '^Date' "filename" | cut -d' ' -f3-

    Feb 2018 15:16:34 +0100

    ... but... cat file manual ...

    Date: 13 Feb 2018 15:16:34 +0100 ... so .. changing f3 to f2 gives

    13 Feb 2018 15:16:34 +0100

    but on other files f2 gives

    Tue, 26 Mar 2019 11:42:00 +0100


    Date: Tue, 26 Mar 2019 11:42:00 +0100


    so SOMETIMES there is a day included, sometimes not ! it seems to depends on the email client of the sender. 


    Some mails have the right file timestamp (i edited them manually) but does not show correctly in apple mail... it stays the import date


    2) there seems different paths depending on plesk version / linux

    '/usr/local/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/mail-migrator/linux/plesk_mail_migrator/providers/maildir': No such file or directory



    root@local:~# find / -name





  • Avatar
    Peter Hansen

    i solved the problem by extracting the tar files of the mailnames manual and copy the existing files with rsync -a /extract_domain.tld/ /var/qmail/mailnames/domain.tld 


    by extracting the backup.tar with tar -xf all timestamps are correct. this is a huge plesk bug

  • Avatar
    Alexandr Bashurov

    @Peter Hansen,
    The clients indeed may skip the day of week part of the date as specified in the RFC 2822:
    Script was modified to extract the whole value of the 'Date:' header and process it.

    The path of the module's files does not depend on the Plesk version. As noted in the article, this issue is related only to the Site Import extension, as it loads the messages through IMAP and does not preserve the timestamps.
    From the output I see that only Plesk Migrator is installed on the server, the Migrator should not be affected by this issue: it transfers messages over `rsync` and packs data into archives, preserving original timestamps.

  • Avatar
    Peter Hansen

    @Alexandr Bashurov,

    I restore a backup of a domain and all timestamps where set to the restoration timepoint. This behaviour is also submitted here:


    Never the less, I got the same problem with the mailaccounts, because all files had the wrong timestamp. The correct timestamps are saved in the backup.tar archive. For me, it only works if I rsync the manual extracted files of the tar archive over the restored files. But I will try your updated version of the script later. Maybe it works now. 

  • Avatar
    Alisa Kasyanova

    @Peter Hansen
    Let us know the results, please. You may drop a comment here or create a request to our support as per if you want us to investigate the issue in more details. Thanks!

  • Avatar
    Peter Hansen

    Again... Seems not to work !

    1) File list


    2) Script with Verbose = true

    3) result of maildir with example cat

  • Avatar
    Alisa Kasyanova

    @Peter Hansen
    Please note the following: by default, only messages created in the last 2 days will be modified. This is done to prevent changing timestamps on non-imported messages. It can be tweaked by setting a different value to the UPDATED_BEFORE variable in script.
    Try changing the UPDATED_BEFORE="2" value to a higher one, for example, to 10 or 30.
    If you have already changed this value, can you please tell me to which value? Thanks.

  • Avatar
    Maarten Wilbers

    Hello, my mail is not at the standard location, and apparently the second option does not work then. 

  • Avatar
    Alisa Kasyanova

    @Maarten Wilbers
    You may edit the MAIL_D="/var/qmail/mailnames/" in the script to your mail location.

Please sign in to leave a comment.

Have more questions? Submit a request