projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update template/welcome-message-800 to match the actual template used on
[mirror/userdir-ldap.git]
/
ud-emailmatcher
diff --git
a/ud-emailmatcher
b/ud-emailmatcher
index
daf76cd
..
4d42d77
100755
(executable)
--- a/
ud-emailmatcher
+++ b/
ud-emailmatcher
@@
-3,7
+3,7
@@
# This script tries to match a list of email addresses to the ldap database
# uids. It makes use of the PGP key ring to determine matches
# This script tries to match a list of email addresses to the ldap database
# uids. It makes use of the PGP key ring to determine matches
-import
string,
re, time, ldap, getopt, sys;
+import re, time, ldap, getopt, sys;
from userdir_ldap import *;
from userdir_gpg import *;
from userdir_ldap import *;
from userdir_gpg import *;
@@
-13,14
+13,14
@@
AddressSplit = re.compile("(.*).*<([^@]*)@([^>]*)>");
def ImportForward(File,EmailMap):
F = open(File,"r");
while(1):
def ImportForward(File,EmailMap):
F = open(File,"r");
while(1):
- Line =
string.strip(F.readline());
+ Line =
F.readline().strip()
if Line == "":
break;
if Line == "":
break;
- Split =
string.split(Line,":");
+ Split =
Line.split(":")
if len(Split) != 2:
continue;
if len(Split) != 2:
continue;
- Addr =
string.strip(Split[1]);
+ Addr =
Split[1].strip()
if EmailMap.has_key(Addr) and EmailMap[Addr] != Split[0]:
print "Dup Over Emap",Line,Split
else:
if EmailMap.has_key(Addr) and EmailMap[Addr] != Split[0]:
print "Dup Over Emap",Line,Split
else:
@@
-34,12
+34,12
@@
def ImportOverride(File,OverMap):
Line = F.readline();
if Line == "":
break;
Line = F.readline();
if Line == "":
break;
- Line =
string.strip(Line);
+ Line =
Line.strip()
- Split =
string.split(Line,":");
+ Split =
Line.split(":")
if len(Split) != 2:
continue;
if len(Split) != 2:
continue;
- OverMap[Split[0]] =
string.strip(Split[1]);
+ OverMap[Split[0]] =
Split[1].strip()
F.close();
(options, arguments) = getopt.getopt(sys.argv[1:], "o:f:")
F.close();
(options, arguments) = getopt.getopt(sys.argv[1:], "o:f:")
@@
-50,10
+50,9
@@
for x in arguments:
Args.append("--keyring");
Args.append(x);
Args = Args + GPGSearchOptions + [" 2> /dev/null"]
Args.append("--keyring");
Args.append(x);
Args = Args + GPGSearchOptions + [" 2> /dev/null"]
-Keys = os.popen(
string.join(Args," "),"r");
+Keys = os.popen(
" ".join(Args),"r")
-l = ldap.open(LDAPServer);
-l.simple_bind_s("","");
+l = connectLDAP()
# Fetch the key list and map to email address
PasswdAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=*",\
# Fetch the key list and map to email address
PasswdAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=*",\
@@
-80,7
+79,7
@@
while(1):
if Line == "":
break;
if Line == "":
break;
- Split =
string.split(Line,":");
+ Split =
Line.split(":")
if len(Split) >= 8 and Split[0] == "pub":
if FingerPrint != None and UID != None:
for x in Emails:
if len(Split) >= 8 and Split[0] == "pub":
if FingerPrint != None and UID != None:
for x in Emails:
@@
-124,9
+123,9
@@
while(1):
Line = sys.stdin.readline();
if Line == "":
break;
Line = sys.stdin.readline();
if Line == "":
break;
- Line =
string.strip(Line);
+ Line =
Line.strip()
- Split =
string.split(Line,"@");
+ Split =
Line.split("@")
if len(Split) != 2:
continue;
if len(Split) != 2:
continue;
@@
-134,7
+133,7
@@
while(1):
if Split[1] == EmailAppend:
if FinalMap.has_key(Line):
print "Dup",Line
if Split[1] == EmailAppend:
if FinalMap.has_key(Line):
print "Dup",Line
- Split2 =
string.split(Split[0],"-");
+ Split2 =
Split[0].split("-")
FinalMap[Line] = Split2[0];
continue;
FinalMap[Line] = Split2[0];
continue;
@@
-146,7
+145,7
@@
while(1):
continue;
# Try again splitting off common address appendage modes
continue;
# Try again splitting off common address appendage modes
- Split2 =
string.split(Split[0],"-");
+ Split2 =
Split[0].split("-")
Addr = Split2[0]+'@'+Split[1];
if EmailMap.has_key(Addr):
if FinalMap.has_key(Addr):
Addr = Split2[0]+'@'+Split[1];
if EmailMap.has_key(Addr):
if FinalMap.has_key(Addr):