diff options
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 62b7335c9..845178137 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -231,7 +231,7 @@ def QuotePeriods(text): # TBD: what other characters should be disallowed? -_badchars = re.compile('[][()<>|;^],') +_badchars = re.compile('[][()<>|;^,]') def ValidateEmail(str): """Verify that the an email address isn't grossly invalid.""" @@ -445,6 +445,14 @@ def GetRandomSeed(): return "%c%c" % tuple(map(mkletter, (chr1, chr2))) +def MakeRandomPassword(length=4): + password = "" + while len(password) < length: + password = password + GetRandomSeed() + password = password[:length] + return password + + def SnarfMessage(msg): if msg.unixfrom: text = msg.unixfrom + string.join(msg.headers, '') + '\n' + msg.body |
