I changed the password with the command "passwd admin" to letters and numbers.
You should not have done that. root and admin passwords are now out of sync.
If you change from command line, you need to change both admin and root passwords to the same thing.
Meanwhile you still haven't properly diagnosed what is wrong, and you are changing stuff on your system, making diagnosis of the original problem even harder.
Can you log in to 'admin' IMAP mailbox from Thunderbird? That would help clarify whether it is a webmail specific problem, or is a password or IMAP issue.