There are exim4 users stored in mysql passwords in MD5

CREATE TABLE mailboxes ( id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, domain_id INT(10) NOT NULL, local_part VARCHAR(250) NOT NULL, password VARCHAR(100) NULL, description VARCHAR(250) NULL, active TINYINT(1) NOT NULL DEFAULT 0, created TIMESTAMP NOT NULL DEFAULT NOW(), modified TIMESTAMP NULL ); 

I set the password like this

 INSERT INTO mailboxes VALUES(NULL,1,'joe',MD5('password'),'My account for joe@mydomain.com',1,NOW(),NOW()); 

Accordingly, what needs to be registered in 20_exim4-config_mysql-authenticator for authentication to work?

    1 answer 1

    Respectively what needs to be registered in 20_exim4-config_mysql-authenticator

    probably about the file in the /etc/exim4/conf.d/auth directory?

    something like this (copied from a working system with adaptation to your field names):

     mysql_plain: driver = plaintext public_name = PLAIN server_condition = ${lookup mysql{select id from mailboxes where local_part = '${quote_mysql:$auth2}' and password = md5('${quote_mysql:$auth3}')}{yes}{no}} server_prompts = : server_set_id = $auth2 mysql_login: driver = plaintext public_name = LOGIN server_condition = ${lookup mysql{select id from mailboxes where local_part = '${quote_mysql:$auth1}' and password = md5('${quote_mysql:$auth2}')}{yes}{no}} server_prompts = Username:: : Password:: server_set_id = $auth1 mysql_cram_md5: driver = cram_md5 public_name = CRAM-MD5 server_secret = ${lookup mysql{select password from mailboxes where local_part = '${quote_mysql:$auth1}'}{$value}fail} server_set_id = $auth2 

    however, I’m not sure about the part about cram_md5 : where I copied, the password in the database is written in plain text. Use the examples from /etc/exim4/conf.d/auth/30_exim4-config_examples to adapt.

    however, judging by this, for example, instruction , then without this part (about cram_md5 ) it should work.