Bug 310428

Summary: Problem with adding and removing identities
Product: [Applications] kmail2 Reporter: Pal Körössy <korossy>
Component: config dialogAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: aldo.latino, gerhardk, kdenis, montel, thiago.bauermann
Priority: NOR    
Version: 5.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: emailidentities file with 2000 identities

Description Pal Körössy 2012-11-21 07:54:38 UTC
A few days ago I added a new identity in KMals config dialog Identity settings. Shortly after that I deleted that identity and realised that some (5 or 6) new 'Unnamed' identity was created. Tried to remove them but the number of Unnamed identities are doubled to 10-12. If I try to remove any of them, twice of the removed Unnamed identities is created so now I have about 30 of them.
I haven't experienced this problem before or in my other computer configured with the same settings.
Since then I'm having the following problem too:
If I compose a mail with the default identity that has a signature configured, no signature is inserted into the message body at all.

Reproducible: Always
Comment 1 Laurent Montel 2012-11-21 21:00:36 UTC
Ok will look at it soon
Comment 2 Pal Körössy 2012-11-26 09:39:48 UTC
~/.kde4/config/emailidentities file has 7 normal identities and over 400 (!) "unnamed" identities:

[Identity #424]
Dictionary=Hungarian (Hungary)
Identity=Unnamed
Image Location=
Inline Signature=
Signature Enabled=false
uoid=1421546402

I've removed the "unnamed" ones and kmail seems to work again.
Comment 3 Thiago Jung Bauermann 2013-04-12 23:07:18 UTC
I am having this problem too, in Kubuntu 12.04.2 with KDE 4.10.2. I have 1152 identities right now...
Comment 4 Thiago Jung Bauermann 2015-01-15 21:22:06 UTC
A high number of identities leads to severe performance degradation in korganizer (bug 341776)

Because of this history of bugs which add an unreasonable number of identities, and because that has severe performance implications I suggest adding a sanity check to kmail/korganizer that checks if the user has tens of empty identities, all called "Unnamed" (and also the localized version of the string, I have hundreds of "Unnamed" and hundreds of "Unbennant" identities), and if so prompts the user asking if he wants them deleted.
Comment 5 Laurent Montel 2015-01-16 06:43:47 UTC
Still with kde 4.10.2 ?
Or new version ?
for the moment I can't reproduce create empty identity here.
Comment 6 Thiago Jung Bauermann 2015-01-16 16:00:29 UTC
I'm currently on KDE 4.14.2. I don't know if it is still reproducible.

But my point in comment 4 is that even if it isn't reproducible anymore, many people will still have hundreds of identities because they were affected by this bug in a previous release. The only way to remove the identities is to edit an obscure configuration file.

I think it makes sense for current KMail releases to clean that up automatically. The performance degradation in bug 341776 is currently reproducible, and it greatly affects usage of KOrganizer. It's not just showing/hiding resources. Everytime you try to add or edit an event, for instance, you get 100% CPU usage and frozen UI for several tens of seconds.
Comment 7 Laurent Montel 2015-01-16 16:16:39 UTC
For me it's not reproductible.
but ok I can look at to remove "invalid" identity.
but i need to know what is an invalid identity :)
Comment 8 Thiago Jung Bauermann 2015-01-16 16:55:01 UTC
Created attachment 90455 [details]
emailidentities file with 2000 identities

> but i need to know what is an invalid identity :)

Makes sense. :-)

This is my emailidentities file. All entries called "Unnamed" and "Unbennant" were created because of a bug and are what I'm calling "empty identities".
Comment 9 Laurent Montel 2015-01-16 22:05:39 UTC
Git commit ac6fc3fbfed49bd948da18bd94ffd2203c782ad5 by Montel Laurent.
Committed on 16/01/2015 at 22:05.
Pushed by mlaurent into branch 'KDE/4.14'.

Don't load invalid identity

M  +9    -5    kpimidentities/identitymanager.cpp

http://commits.kde.org/kdepimlibs/ac6fc3fbfed49bd948da18bd94ffd2203c782ad5
Comment 10 Laurent Montel 2015-01-16 22:11:47 UTC
With this patch I fix problem with invalid identity.
But I can't close this bug as I can't reproduce and I don't know if it's fixed.
Comment 11 Thiago Jung Bauermann 2015-01-17 18:13:02 UTC
(In reply to Laurent Montel from comment #10)
> With this patch I fix problem with invalid identity.

Wow that was fast. Thanks!
With this pach I believe bug 341776 is fixed and can be closed.
Comment 12 Gerhard Kulzer 2016-04-21 13:57:26 UTC
I'm using Kmail/Kontakt 5.0.2 and still have that same problem. Every week kind of I have to delete hundreds of identities.
Comment 13 Denis Kurz 2017-01-14 13:17:51 UTC
Confirmed due to Comment 12. Actually, Gerhard confirmed it for 5.0.1, which is not in the version list, so I chose 5.1.