Changeset

410:abac17cb5032

mod_auth_dovecot: Make appending the domain name configurable. Warning: If you depend on this behaviour, add auth_append_host = true to your config
author Kim Alvefur <zash@zash.se>
date Fri, 02 Sep 2011 00:47:31 +0200
parents 409:df57fa689415
children 411:b3a5439a16bf
files mod_auth_dovecot/mod_auth_dovecot.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_dovecot/mod_auth_dovecot.lua	Tue Aug 30 23:12:56 2011 +0000
+++ b/mod_auth_dovecot/mod_auth_dovecot.lua	Fri Sep 02 00:47:31 2011 +0200
@@ -16,6 +16,7 @@
 
 local prosody = prosody;
 local socket_path = module:get_option_string("dovecot_auth_socket", "/var/run/dovecot/auth-login");
+local append_host = module:get_option_boolean("auth_append_host", false);
 
 function new_provider(host)
 	local provider = { name = "dovecot", request_id = 0 };
@@ -125,7 +126,9 @@
 		end
 		
 		-- Send auth data
-		username = username .. "@" .. module.host; -- FIXME: this is actually a hack for my server
+		if append_host then
+			username = username .. "@" .. module.host;
+		end
 		local b64 = base64.encode(username .. "\0" .. username .. "\0" .. password);
 		provider.request_id = provider.request_id + 1 % 4294967296