1 |
slords |
1.1 |
From 0d2b724b9317bbfddf402279ceff2f523814b8ac Mon Sep 17 00:00:00 2001 |
2 |
|
|
From: Robin Bowes <robin@hero.robinbowes.com> |
3 |
|
|
Date: Mon, 10 May 2010 10:01:30 +0100 |
4 |
|
|
Subject: Check for the exact string resonses from vpopmaild rather than using regexes |
5 |
|
|
|
6 |
|
|
--- |
7 |
|
|
plugins/auth/auth_vpopmaild | 6 ++---- |
8 |
|
|
1 files changed, 2 insertions(+), 4 deletions(-) |
9 |
|
|
|
10 |
|
|
diff --git a/plugins/auth/auth_vpopmaild b/plugins/auth/auth_vpopmaild |
11 |
|
|
index 623d919..d30eaed 100644 |
12 |
|
|
--- a/plugins/auth/auth_vpopmaild |
13 |
|
|
+++ b/plugins/auth/auth_vpopmaild |
14 |
|
|
@@ -37,9 +37,7 @@ sub auth_vpopmaild { |
15 |
|
|
|
16 |
|
|
# Get server greeting (+OK) |
17 |
|
|
my $connect_response = <$vpopmaild_socket>; |
18 |
|
|
- if (!$connect_response =~ /\+OK.*/) { |
19 |
|
|
- return DECLINED; |
20 |
|
|
- } |
21 |
|
|
+ return DECLINED unless $connect_response eq '+OK \r\n'; |
22 |
|
|
|
23 |
|
|
# send login details |
24 |
|
|
print $vpopmaild_socket "login $user $passClear\n\r"; |
25 |
|
|
@@ -50,7 +48,7 @@ sub auth_vpopmaild { |
26 |
|
|
close($vpopmaild_socket); |
27 |
|
|
|
28 |
|
|
# check for successful login |
29 |
|
|
- if ($login_response =~ /\+OK.*/) { |
30 |
|
|
+ if ($login_response eq '+OK+\r\n') { |
31 |
|
|
return (OK, 'authcheckpassword'); |
32 |
|
|
} |
33 |
|
|
else { |
34 |
|
|
-- |
35 |
|
|
1.7.2.2 |
36 |
|
|
|