[kmail2] [Bug 370385] EMail Addresses with Underscores in Contacts Not Recognised

Sandro Knauß bugzilla_noreply at kde.org
Wed Feb 3 02:27:21 GMT 2021


https://bugs.kde.org/show_bug.cgi?id=370385

Sandro Knauß <sknauss at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|general                     |search
             Status|REPORTED                    |CONFIRMED
           Platform|Archlinux Packages          |Compiled Sources
                 CC|                            |sknauss at kde.org
     Ever confirmed|0                           |1
            Version|5.3.0                       |5.16.1

--- Comment #3 from Sandro Knauß <sknauss at kde.org> ---
I can confirm this. It is an issue of the indexer in akonadi-search. I already
created a unit test for it:

diff --git a/akonadiplugin/autotests/searchplugintest.cpp
b/akonadiplugin/autotests/searchplugintest.cpp
index eb7e84a..fde4500 100644
--- a/akonadiplugin/autotests/searchplugintest.cpp
+++ b/akonadiplugin/autotests/searchplugintest.cpp
@@ -160,7 +160,7 @@ private Q_SLOTS:
             b->setBody("body4");
             msg->addContent(b, true);

-            msg->from()->addAddress("john at test.com", QStringLiteral("John
Doe"));
+            msg->from()->addAddress("john_rt at test.com", QStringLiteral("John
Doe"));
             msg->to()->addAddress("jane at test.com", QStringLiteral("Jane
Doe"));
             msg->cc()->addAddress("cc at test.com", QStringLiteral("Jane Doe"));
             msg->bcc()->addAddress("bcc at test.com", QStringLiteral("Jane
Doe"));
@@ -265,7 +265,8 @@ private Q_SLOTS:
             KContacts::Addressee addressee;
             addressee.setUid(QStringLiteral("uid2"));
             addressee.setName(QStringLiteral("Jane Doe"));
-            addressee.setEmails(QStringList() <<
QStringLiteral("jane at test.com"));
+            addressee.setEmails({QStringLiteral("jane at test.com"),
+                    QStringLiteral("jane_rt at test.com")});
 #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
             addressee.setBirthday(QDateTime(QDate(2000, 01, 01)));
 #else
@@ -661,6 +662,13 @@ private Q_SLOTS:
             QSet<qint64> result = QSet<qint64>() << 101 << 102;
             QTest::newRow("contact by email") <<
QString::fromLatin1(query.toJSON()) << collections << contactMimeTypes <<
result;
         }
+        {
+            Akonadi::SearchQuery query;
+           
query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Email,
QStringLiteral("JANE_RT at TEST.COM"), Akonadi::SearchTerm::CondContains));
+            QVector<qint64> collections({3});
+            QSet<qint64> result({101});
+            QTest::newRow("contact by email2") <<
QString::fromLatin1(query.toJSON()) << collections << contactMimeTypes <<
result;
+        }
         {
             Akonadi::SearchQuery query;
            
query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Name,
QStringLiteral("Doe"), Akonadi::SearchTerm::CondContains));
@@ -1099,6 +1107,13 @@ private Q_SLOTS:
             QSet<qint64> result = QSet<qint64>() << 1 << 2 << 3 << 4 << 5 <<
6;
             QTest::newRow("search by from email part") <<
QString::fromLatin1(query.toJSON()) << allEmailCollections << emailMimeTypes <<
result;
         }
+        {
+            Akonadi::SearchQuery query;
+           
query.addTerm(Akonadi::EmailSearchTerm(Akonadi::EmailSearchTerm::HeaderFrom,
QStringLiteral("john_rt at test.com"), Akonadi::SearchTerm::CondContains));
+            QSet<qint64> result({4});
+            QTest::newRow("search by from email part") <<
QString::fromLatin1(query.toJSON()) << allEmailCollections << emailMimeTypes <<
result;
+        }
+
     }

     void testEmailSearch()

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list