Changeset

271:05ea4abb664d

mod_auth_dovecot: Load dovecot socket path form config
author Javier Torres <javitonino@gmail.com>
date Sat, 30 Oct 2010 23:39:22 +0200
parents 270:853ae6ae87bf
children 272:6b35c23664db
files mod_auth_dovecot/mod_auth_dovecot.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_dovecot/mod_auth_dovecot.lua	Sat Oct 30 23:39:06 2010 +0200
+++ b/mod_auth_dovecot/mod_auth_dovecot.lua	Sat Oct 30 23:39:22 2010 +0200
@@ -14,6 +14,7 @@
 local pposix = require "util.pposix";
 
 local prosody = _G.prosody;
+local socket_path = module:get_option_string("dovecot_auth_socket", "/var/run/dovecot/auth-login");
 
 function new_default_provider(host)
 	local provider = { name = "dovecot", c = nil };
@@ -35,10 +36,9 @@
 		provider.c = socket.unix();
 		
 		-- Create a connection to dovecot socket
-		local socket = "/var/run/dovecot/auth-login";
-		local r, e = provider.c:connect(socket);
+		local r, e = provider.c:connect(socket_path);
 		if (not r) then
-			log("warn", "error connecting to dovecot socket at '%s'. error was '%s'. check permissions", socket, e);
+			log("warn", "error connecting to dovecot socket at '%s'. error was '%s'. check permissions", socket_path, e);
 			provider:close();
 			return false;
 		end