diff options
| author | hmeland | 1999-07-01 11:52:40 +0000 |
|---|---|---|
| committer | hmeland | 1999-07-01 11:52:40 +0000 |
| commit | 150c7ed35792ff60899d3d0e8e397767c5bbe02f (patch) | |
| tree | 4ab6c26afdc11f5f3a62b7d8d45b409ee3de2e8d /Mailman/MailCommandHandler.py | |
| parent | 4374fe294e07590ca6864112844f7bc43b11326d (diff) | |
| download | mailman-150c7ed35792ff60899d3d0e8e397767c5bbe02f.tar.gz mailman-150c7ed35792ff60899d3d0e8e397767c5bbe02f.tar.zst mailman-150c7ed35792ff60899d3d0e8e397767c5bbe02f.zip | |
Diffstat (limited to 'Mailman/MailCommandHandler.py')
| -rw-r--r-- | Mailman/MailCommandHandler.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py index a7bbf3f7e..5b8d9424f 100644 --- a/Mailman/MailCommandHandler.py +++ b/Mailman/MailCommandHandler.py @@ -265,10 +265,22 @@ The following is a detailed description of the problems. self.__NoMailCmdResponse = 0 def ProcessPasswordCmd(self, args, cmd, mail): - if len(args) <> 2: - self.AddError("Usage: password <oldpw> <newpw>") + if len(args) not in [0,2]: + self.AddError("Usage: password [<oldpw> <newpw>]") return sender = mail.GetSender() + if len(args) == 0: + # Mail user's password to user + user = self.FindUser(sender) + if user and self.passwords.has_key(user): + self.AddToResponse("You are subscribed as %s,\n" + " with password: %s" % + (user, self.passwords[user]), + trunc=0) + else: + self.AddError("Found no password for %s" %sender, trunc=0) + return + # Try to change password try: self.ConfirmUserPassword(sender, args[0]) self.ChangeUserPassword(sender, args[1], args[1]) |
