Permalink
Browse files

vpopmail: fail faster during a CRAM-MD5 auth attempt with an invalid …

…username
  • Loading branch information...
msimerson committed May 14, 2014
1 parent ed90eb4 commit fb890bee91786f374f582c0c5dde92c8f395a1f0
Showing with 8 additions and 1 deletion.
  1. +8 −1 plugins/auth/auth_vpopmaild.js
@@ -140,7 +140,14 @@ exports.get_plain_passwd = function (user, cb) {
socket.end(); // disconnect
}
if (chunk_count > 2) {
- if (!/clear_text_password/.test(chunk)) { return; }
+ if (/^\-ERR/.test(chunk)) {
+ plugin.logerror("get_plain failed: " + chunk);
+ socket.end(); // disconnect
+ return;
+ }
+ if (!/clear_text_password/.test(chunk)) {
+ return; // pass might be in the next chunk
+ }
var pass = chunk.match(/clear_text_password\s(\S+)\s/);
plain_pass = pass[1];
socket.write("quit\n\r");

0 comments on commit fb890be

Please sign in to comment.