D12019: make sure to create unique filename in maildir resource

Martin Koller noreply at phabricator.kde.org
Sat Apr 7 13:16:42 BST 2018


mkoller created this revision.
mkoller added a reviewer: mlaurent.
Restricted Application added a project: KDE PIM.
Restricted Application added a subscriber: KDE PIM.
mkoller requested review of this revision.

REVISION SUMMARY
  While having akonadiconsole open by chance, I saw a few error messages like:
  
  AgentBase(akonadi_maildir_resource_0): Could not move message '1521037293.R521 <https://phabricator.kde.org/source/smokegen/>.lapi.koller' from '/home/koller/Mail/inbox' to '/home/koller/Mail/.z_div. privat.directory/KDE-FW-Devel'. The error was Destination file exists.
  
  and in fact this is correct - I really have some mail filenames with the same name.
  I assume that this can happen when during maildownload (POP3) and filtering a mail from the inbox is moved to the filter target folder
  and within the same second a new mailfile shall be created. In my case both files come from the same mailinglist.
  (why also the random part is then the same seems just to be bad luck).
  
  This patch changes the "current-time + random" way to use QUuid - which from the source seems it was the original idea but due to a Qt bug in an old Qt version, it was not used
  https://bugreports.qt.io/browse/QTBUG-8374
  
  Since this bug is solved since Qt 4.7, I feel this patch is a much safer approach to generate a unique file name.

REPOSITORY
  R44 KDE PIM Runtime

REVISION DETAIL
  https://phabricator.kde.org/D12019

AFFECTED FILES
  maildir.cpp

To: mkoller, mlaurent
Cc: #kde_pim, dvasin, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20180407/622ce2a9/attachment.html>


More information about the kde-pim mailing list