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

Follow

Comments

7 comments

  • 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

    file:

    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 provider.py

    /opt/psa/admin/plib/modules/wp-toolkit/vendor/plesk/plesk-migrator/backend/lib/python/parallels/core/extras/mail-migrator/linux/plesk_mail_migrator/providers/imap/provider.py

    /opt/psa/admin/plib/modules/wp-toolkit/vendor/plesk/plesk-migrator/backend/lib/python/parallels/core/extras/mail-migrator/linux/plesk_mail_migrator/providers/maildir/provider.py

    /opt/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/core/extras/mail-migrator/linux/plesk_mail_migrator/providers/imap/provider.py

    /opt/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/core/extras/mail-migrator/linux/plesk_mail_migrator/providers/maildir/provider.py

  • 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: https://tools.ietf.org/html/rfc2822#section-3.3
    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:

    https://support.plesk.com/hc/en-us/articles/360020362873-File-timestamps-are-reset-upon-the-restoration-from-backup

     

    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 https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support- 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.

Please sign in to leave a comment.

Have more questions? Submit a request