0

I made the appropriate changes to postfix to get mysql 5.7 working as the database instead fo Maria DB. I can run tests and all seems to work on the server. However, I cannot log into my account from my email client. I continue to get 'invalid login' errors and I have checked the email address and password multiple times.

I noticed that postfix uses the 'encrypt' option for the password on the users table and also that on Mysql 5.7, there is an option to add a key for this feature. This wasn't the case on 5.6 and below. Does anyone know specifically if this is the issue and if so, is there a fix for postfix to put the encryption key somewhere? Or is postfix just NOT compatible with Mysql 5.7? I cannot run mariaDB on this server.

Thanks in advance.

EDIT: There are two sql queries in many of the default configs that do not work in Mysql 5.7

in mysql-virtual_domains.cf:

SELECT domain AS virtual FROM domains WHERE domain='%s'

should be changed to

SELECT domain AS `virtual` FROM domains WHERE domain='%s'

(back-ticks added to reserved keyword)

in mysql-virtual_mailboxes.cf

SELECT CONCAT(SUBSTRING_INDEX(`email`,<'@'>,-1),'/',SUBSTRING_INDEX(`email`,<'@'>,1),'/') FROM users WHERE email='%s'

should be changed to

SELECT CONCAT(SUBSTRING_INDEX(`email`,'@',-1),'/',SUBSTRING_INDEX(`email`,'@',1),'/') FROM users WHERE email='%s'

(remove <>)

Doug Wolfgram
  • 135
  • 2
  • 7

1 Answers1

1

As far as postfix is concerned, there should be no difference between mysql and mariadb. In postfix, you can specify which SQL commands should be used to access the data base. Don't use mysql specific encryption for passwords, it has changed in the past and may change again.

RalfFriedl
  • 3,108
  • 4
  • 13
  • 17
  • Thanks. I did find that there is a query, SELECT domain AS virtual FROM domains where domain='%s' Where in mysql 5.7 you have to put the 'virtual' in back ticks as it is a reserved word. Other than that, for some reason it is rejecting my logins even though it worked on my previous server which was running 5.6. – Doug Wolfgram Aug 01 '18 at 23:13
  • And suddenly, magically, it starts working. Thanks for helping me not waste a lot of time going down the wrong path. That is an often-overlooked value in debugging systems. :) – Doug Wolfgram Aug 01 '18 at 23:35