encrypt password/string in MariaDB (mailserver purpose)

I set up a mail server and the users info is in the database. And here starts my question I wanna encrypt the paswords that are in the database I’m using MariaDB I’ve red this https://mariadb.com/kb/en/aes_encrypt/ so like I’ve a database users I do

INSERT INTO users (pass) VALUES (AES_ENCRYPT('text',SHA2('password',512))); 

but what about that value 'text does it matter somewhat? I mean when user logs in and types password would it matter?
And another question I’ve binded myql with postfix this way


lloks like that

additional_conditions = and enabled = 1

but I want multiple users so there’d be different values for different users in table : users ->field : pass but in that file /mailbox.cf there’s only one .
I know I can use yast ->network services-> mail server but there’s only option for one user i.e. I’ve set up the server manually and the changes will over yast will overwrite the files like /etc/postfix/main.cf I’ve virtual users…

‘text’ : the passwords of your users
‘password’ : the key to encrypt/decrypt your users passwords

More reading:


thanks so the ‘password’ (the encryption key as you said ) in that command belongs to field : password = mailPASSWORD in table users right?

No. ‘text’ is the placeholder for whatever content you want to encrypt, here your “mailPASSWORD”.

In your example:


The application, that want’s to read/write your mailuser account’s passwords, has to provide the “crypt_key”.