diff options
Diffstat (limited to '')
-rw-r--r-- | Mailman/Queue/CommandRunner.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 785511b3..5bc1599b 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -140,13 +140,25 @@ Attached is your original message. if unprocessed: resp.append(_('\n- Unprocessed:')) resp.extend(indent(unprocessed)) + if not unprocessed and not self.results: + # The user sent an empty message; return a helpful one. + resp.append(Utils.wrap(_("""\ +No commands were found in this message. +To obtain instructions, send a message containing just the word "help". +"""))) if self.ignored: resp.append(_('\n- Ignored:')) resp.extend(indent(self.ignored)) resp.append(_('\n- Done.\n\n')) - results = MIMEText( - NL.join(resp), - _charset=Utils.GetCharSet(self.mlist.preferred_language)) + # Encode any unicode strings into the list charset, so we don't try to + # join unicode strings and invalid ASCII. + charset = Utils.GetCharSet(self.mlist.preferred_language) + encoded_resp = [] + for item in resp: + if isinstance(item, UnicodeType): + item = item.encode(charset, 'replace') + encoded_resp.append(item) + results = MIMEText(NL.join(encoded_resp), _charset=charset) # Safety valve for mail loops with misconfigured email 'bots. We # don't respond to commands sent with "Precedence: bulk|junk|list" # unless they explicitly "X-Ack: yes", but not all mail 'bots are |