comparison mod_auth_dovecot/mod_auth_dovecot.lua @ 311:f663ea45436f

mod_auth_dovecot: Only check Dovecot major version. Bump log level from 'warn' to 'error'. (thanks Adrien Clerc)
author Matthew Wild <mwild1@gmail.com>
date Sat, 08 Jan 2011 17:08:20 +0000
parents b3bcd1913c85
children 31deafcbf623
comparison
equal deleted inserted replaced
310:b3bcd1913c85 311:f663ea45436f
67 log("debug", "dovecot handshake: '%s'", l); 67 log("debug", "dovecot handshake: '%s'", l);
68 parts = string.gmatch(l, "[^\t]+"); 68 parts = string.gmatch(l, "[^\t]+");
69 first = parts(); 69 first = parts();
70 if (first == "VERSION") then 70 if (first == "VERSION") then
71 -- Version should be 1.1 71 -- Version should be 1.1
72 local v1 = parts(); 72 local major_version = parts();
73 local v2 = parts();
74 73
75 if (not (v1 == "1" and v2 == "1")) then 74 if major_version ~= "1" then
76 log("warn", "server version is not 1.1. it is %s.%s", v1, v2); 75 log("error", "dovecot server version is not 1.x. it is %s.x", major_version);
77 provider:close(); 76 provider:close();
78 return false; 77 return false;
79 end 78 end
80 elseif (first == "MECH") then 79 elseif (first == "MECH") then
81 -- Mechanisms should include PLAIN 80 -- Mechanisms should include PLAIN