Problems with OMEMO and eJabberd accounts

I'm a Jabber fan. And I like the work from Andreas Straub who developed OMEMO, the Signal protocol for Jabber. In pratice this gives a good grade of privacy to Jabber (XMPP). Unfortunately I ran in problems on two accounts I couldn't solve. Th symptom was that sometimes messages for these accounts weren't encrypted with the related keys but with an other key so I the client wasn't able to decrypt them. To solve it I started Gajim in debug mode for the OMEMO plugin:

gajim -l gajim.plugin_system.omemo=DEBUG

The result was this error line:

(E) gajim.plugin_system.omemo <jid> => Publishing devicelist failed: forbidden

For some reasons I don't know the client wasn't able to publish it's device list. I double checked the configuration of my ejabberd server but everything seems allright. Then I had an idea: maybe there is a problem with the account settings? eJabberd is runing for a long time on my servers and it could be possible that some account settings got corrupted over the years and the server updates.

So finally I registered a new account to test the OMEMO functionallity with the result, that everything worked as aspected. No more errors!

I don't know what was wrong with my accounts, but after deleting an recreating my accounts the problems with OMEMO are gone.