[GnuPG Logo]    
· English ·        
Links  
   
 
authorMarkus Montkowski <[email protected]>
Tue, 1 Jul 2025 11:26:24 +0000 (13:26 +0200)
committerMarkus Montkowski <[email protected]>
Tue, 1 Jul 2025 11:26:24 +0000 (13:26 +0200)
* src/folder-events.cpp: Search via searchMailsByUUID and use first
                            mail found if getMailByUUID fails

--
For mails that don't have a GPGOL_UID property get_unique_id returns
the Message-ID and no longer null. Calling getMailByUUID will fail. In
thats case we fallback to calling the slower searchMailsByUUID as that
will call get_unique_id for each mail, so it finds those mails via the
Message-ID and moving works again.

GnuPG-Bug-Id: 7712

src/folder-events.cpp

index 7a4b34519307c74df604eaec39603f63ec9de74c..10b4e22dcd0fdcf73d442dfa78287bc8e3df0fd2 100644 (file)
@@ -105,7 +105,23 @@ EVENT_SINK_INVOKE(FolderEvents)
             }
 
           Mail *mail = Mail::getMailForUUID (uid);
+          if (!mail)
+            {
+              auto retV = Mail::searchMailsByUUID(uid);
+              if (!retV.empty())
+                {
+                  mail = retV.front();
+                }
+              else
+                {
+                  log_debug ("%s:%s: Failed to find mail %p in map.",
+                            SRCNAME, __func__, mailitem);
+                }
+                TRACEPOINT;
+            }
+          TRACEPOINT;
           xfree (uid);
+
           if (!mail)
             {
               log_error ("%s:%s: Failed to find mail for uuid",
 
   
 
 
  Technical resources for this
service are sponsered by
 
  g10 Code GmbH  

Valid XHTML 1.0!     Peace!     Valid CSS!