Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/mailserver/dovecot-sql.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ driver = mysql
connect = host=<%= @db_hosts %> dbname=<%= @db_name %> user=<%= @db_user %> password=<%= @db_pass %>
default_pass_scheme = CRYPT
user_query = SELECT CONCAT('maildir:<%= @mailbox_base %>/', maildir) AS mail, '2000' AS uid, '2000' AS gid, CONCAT('maildir:storage=', floor(quota*1024)) AS quota FROM user WHERE email = (SELECT IF((SELECT email from user where email = '%u') is not null, '%u', CONCAT('@','%d')))
password_query = SELECT email AS user, NULL as password, 'Y' as nopassword FROM user WHERE email = '%u' AND (ENCRYPT('%w', LEFT(password, 2)) = password OR MD5('%w') = password)
password_query = SELECT email AS user, NULL as password, 'Y' as nopassword FROM user WHERE email = '%u' AND (ENCRYPT('%w', LEFT(password, 2)) = password OR MD5('%w') = password) AND status = 'active'
2 changes: 1 addition & 1 deletion templates/mailserver/mysql_virtual_mailbox_maps.cf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ hosts = <%= @db_hosts %>
dbname = <%= @db_name %>
user = <%= @db_user %>
password = <%= @db_pass %>
query = SELECT maildir FROM user WHERE email = '%s'
query = SELECT maildir FROM user WHERE email = '%s' AND status = 'active'