dovecot-sql.conf.ext 1.0 KB

1234567891011121314151617181920212223
  1. # Not complete!!
  2. # Covers only changes to queries
  3. password_query = SELECT \
  4. CONCAT(`virtual_users`.`username`, '@', `virtual_domains`.`name`) as `user`, `virtual_users`.`password` \
  5. FROM `mailserver`.`virtual_users` \
  6. INNER JOIN `mailserver`.`virtual_domains` \
  7. ON `virtual_domains`.`id` = `virtual_users`.`domain_id` \
  8. AND `virtual_domains`.`name` = SUBSTRING_INDEX('%u', '@', -1) \
  9. WHERE `virtual_users`.`username` = SUBSTRING_INDEX('%u', '@', 1);
  10. # Alternatively (suppport login as aliases) Read more about this in the tutorial
  11. #password_query = SELECT \
  12. # CONCAT(`virtual_users`.`username`, '@', `virtual_domains`.`name`) as `user`, `virtual_users`.`password` \
  13. # FROM `mailserver`.`virtual_alias` \
  14. # INNER JOIN `virtual_users`.`user_id`
  15. # ON `virtual_users`.`id` = `virtual_aliases`.`user_id` \
  16. # INNER JOIN `mailserver`.`virtual_domains` \
  17. # ON `virtual_domains`.`id` = `virtual_users`.`domain_id` \
  18. # AND `virtual_domains`.`name` = SUBSTRING_INDEX('%u', '@', -1) \
  19. # WHERE `virtual_alias`.`alias` = SUBSTRING_INDEX('%u', '@', 1);