aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2016-01-28 10:15:29 -0500
committerTom Ritter <tom@ritter.vg>2016-01-28 10:15:29 -0500
commit1516bb8fe35db2f802519a9c13915d2ddadf174e (patch)
tree279d34c87d1b525751471131c8e06a47cca2edf1
parentf71a7cf525c53f31c82477aea89a5db92ecfb5ea (diff)
Add an option to use or bust gmail threading
-rwxr-xr-xjobs/JobBase.py4
-rwxr-xr-xsettings.cfg.example2
2 files changed, 5 insertions, 1 deletions
diff --git a/jobs/JobBase.py b/jobs/JobBase.py
index 8ecdef4..cdb835d 100755
--- a/jobs/JobBase.py
+++ b/jobs/JobBase.py
@@ -40,7 +40,9 @@ def sendEmail(config, subject, body, to=""):
# Prepare actual message
# Avoid gmail threading
- subject = "[" + config.get('general', 'servername') + "] " + subject + " " + str(random.random())
+ subject = "[" + config.get('general', 'servername') + "] " + subject + " "
+ if config.get('email', 'bustgmailthreading'):
+ subject += str(random.random())
message = """\From: %s\nTo: %s\nSubject: %s\n\n%s""" \
% (FROM, ", ".join(to), subject, body)
try:
diff --git a/settings.cfg.example b/settings.cfg.example
index 02531cf..3ce86f2 100755
--- a/settings.cfg.example
+++ b/settings.cfg.example
@@ -11,6 +11,8 @@ imapserver=imap.gmail.com
#I create a filter that automatically deletes my sent messages.
# This way, anyone who hacks the account only sees the last 30 days of messages I've sent
ideletesentmessagesautomatically=True
+#If set, append a random number to prevent gmail threading
+bustgmailthreading=False
[peers]
peer1=http://someserver.com:5000,admin@someserverbackup.com