make a passwords table so that we have a history

This also fixes a few authentication bugs

I also made debugging with a wrong smtp config easier.