Debian – SASL: How to delete all mech entries from a user

debiansasl

I have a problem with my SASL database.

sasldblistusers2 shows following entries:

myuser@example.com: cmusaslsecretCRAM-MD5
myuser@example.com: cmusaslsecretPLAIN
myuser@example.com: userPassword

I want to delete this user completely. So I run saslpasswd2 -d -u example.com myuser

Now, sasldblistusers2 shows following entries:

myuser@example.com: cmusaslsecretCRAM-MD5
myuser@example.com: cmusaslsecretPLAIN

How can I get rid of the other entries? I am searching for hours for a solution how to get rid of the other mechanisms, but I don't find any single information.

Best Answer

As a last resort, you could try modifying the underlying Berkeley DB database directly. This should only be done with extreme caution: test on a non-production system first, and have a current backup. There's a good chance it simply won't work or could cause issues down the track.

Something like:

db_dump -p /etc/sasldb2 > /tmp/sasldb2.dump
vi /tmp/sasldb2.dump # Find and delete the entries that you don't want
mv /etc/sasldb2 /etc/sasldb2.bak
db_load -f /tmp/sasldb2.dump /etc/sasldb2