[Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.44,
1.45
Tony Meyer
anadelonbrin at users.sourceforge.net
Sat Feb 21 21:31:21 EST 2004
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5361/spambayes
Modified Files:
UserInterface.py
Log Message:
It's too hard to keep track of messages if they all have a "Problem with POP3 Proxy"
subject, so get the user to customize it a bit.
Remove the "to" and "cc" fields, and handle these for the user.
Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** UserInterface.py 16 Feb 2004 09:00:58 -0000 1.44
--- UserInterface.py 22 Feb 2004 02:31:18 -0000 1.45
***************
*** 1051,1056 ****
domain_guess = domain_guess[len(pre):]
report.from_addr.value = "[YOUR EMAIL ADDRESS]@%s" % (domain_guess,)
! report.cc_addr.value = report.from_addr.value
! report.subject.value = "Problem with %s" % (self.app_for_version,)
# If the user has a log file, attach it.
try:
--- 1051,1056 ----
domain_guess = domain_guess[len(pre):]
report.from_addr.value = "[YOUR EMAIL ADDRESS]@%s" % (domain_guess,)
! report.subject.value = "Problem with %s: [PROBLEM SUMMARY]" % \
! (self.app_for_version,)
# If the user has a log file, attach it.
try:
***************
*** 1094,1099 ****
self._writePostamble()
! def onSubmitreport(self, from_addr, to_addr, cc_addr, message,
! subject, attach):
"""Send the help message/bug report to the specified address."""
# For guessing MIME type based on file name extension
--- 1094,1098 ----
self._writePostamble()
! def onSubmitreport(self, from_addr, message, subject, attach):
"""Send the help message/bug report to the specified address."""
# For guessing MIME type based on file name extension
***************
*** 1107,1111 ****
from email.MIMEText import MIMEText
! if not self._verifyEnteredDetails(from_addr, cc_addr, message):
self._writePreamble("Error", ("help", "Help"))
self.write(self._buildBox("Error", "status.gif",
--- 1106,1110 ----
from email.MIMEText import MIMEText
! if not self._verifyEnteredDetails(from_addr, subject, message):
self._writePreamble("Error", ("help", "Help"))
self.write(self._buildBox("Error", "status.gif",
***************
*** 1120,1126 ****
outer = MIMEMultipart()
outer['Subject'] = subject
! outer['To'] = to_addr
! if cc_addr:
! outer['CC'] = cc_addr
outer['From'] = from_addr
outer.preamble = self._wrap(message)
--- 1119,1128 ----
outer = MIMEMultipart()
outer['Subject'] = subject
! # Force the message to "spambayes at python.org", rather than
! # letting the user choose.
! outer['To'] = '"SpamBayes Mailing List" <spambayes at python.org>'
! # Always cc the user, so that they get a copy of the message,
! # even if they're not subscribed to the list.
! outer['CC'] = from_addr
outer['From'] = from_addr
outer.preamble = self._wrap(message)
***************
*** 1168,1172 ****
recips = []
! for r in [to_addr, cc_addr]:
if r:
recips.append(r)
--- 1170,1177 ----
recips = []
! # If you are testing, then make sure you change this
! # address to something else, so that you don't bombard the
! # list with messages.
! for r in ["spambayes at python.org", from_addr]:
if r:
recips.append(r)
***************
*** 1176,1187 ****
self._writePostamble()
! def _verifyEnteredDetails(self, from_addr, cc_addr, message):
"""Ensure that the user didn't just send the form message, and
at least changed the fields."""
! if from_addr.startswith("[YOUR EMAIL ADDRESS]") or \
! cc_addr.startswith("[YOUR EMAIL ADDRESS]"):
return False
if message.endswith("[DESCRIBE YOUR PROBLEM HERE]"):
return False
return True
--- 1181,1193 ----
self._writePostamble()
! def _verifyEnteredDetails(self, from_addr, subject, message):
"""Ensure that the user didn't just send the form message, and
at least changed the fields."""
! if from_addr.startswith("[YOUR EMAIL ADDRESS]"):
return False
if message.endswith("[DESCRIBE YOUR PROBLEM HERE]"):
return False
+ if subject.endswith("[PROBLEM SUMMARY]"):
+ return False
return True
More information about the Spambayes-checkins
mailing list