V
V
vlarkanov2020-04-27 12:49:18
linux
vlarkanov, 2020-04-27 12:49:18

Postfix + Dovecot + MySQL: automatic box creation?

Hello! It was necessary to automatically create mailboxes with a request from the site. For plain text passwords (setting in Dovecot PLAIN), everything is simple, boxes are perfectly created by the request

INSERT INTO mailbox (username, password, name, maildir, local_part, domain, active) VALUES ('[email protected]', 'Qwerty123', 'test_name', 'xx.domain.ru/test_name', 'test_name', 'xx.domain.ru', 1);


There was a need to create boxes with encrypted passwords (setting in Dovecot MD5-CRYPT). How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-27
@MechanID

I can’t check now, but I would form a password in the database something like this:
ENCRYPT('mypassword', CONCAT('$1$', SUBSTRING(MD5(RAND()), -8), '$'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question