aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource/cfg/pyAggr3g470r.cfg-sample1
-rw-r--r--source/conf.py1
-rwxr-xr-xsource/feedgetter.py2
3 files changed, 3 insertions, 1 deletions
diff --git a/source/cfg/pyAggr3g470r.cfg-sample b/source/cfg/pyAggr3g470r.cfg-sample
index a4ac86fb..26d773ef 100755
--- a/source/cfg/pyAggr3g470r.cfg-sample
+++ b/source/cfg/pyAggr3g470r.cfg-sample
@@ -5,6 +5,7 @@ dbname = bob_pyaggr3g470r
user = bob
password = password_of_bob
[mail]
+enabled = 0
mail_from = pyAggr3g470r@no-reply.com
mail_to = address_of_the_recipient@example.com
smtp = smtp.example.com
diff --git a/source/conf.py b/source/conf.py
index e89f0090..18ff0259 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -43,6 +43,7 @@ MONGODB_DBNAME = config.get('MongoDB', 'dbname')
MONGODB_USER = config.get('MongoDB', 'user')
MONGODB_PASSWORD = config.get('MongoDB', 'password')
+MAIL_ENABLED = bool(config.get('mail','enabled'))
mail_from = config.get('mail','mail_from')
mail_to = config.get('mail','mail_to')
smtp_server = config.get('mail','smtp')
diff --git a/source/feedgetter.py b/source/feedgetter.py
index 84dd2f47..bd35e345 100755
--- a/source/feedgetter.py
+++ b/source/feedgetter.py
@@ -155,7 +155,7 @@ class FeedGetter(object):
articles.append(article)
- if feed["mail"] and self.articles.get_articles(feed_id, article_id) == False:
+ if conf.MAIL_ENABLED and feed["mail"] and self.articles.get_articles(feed_id, article_id) == False:
# if subscribed to the feed AND if article not already in the database
threading.Thread(None, utils.send_mail, None, (conf.mail_from, conf.mail_to, \
a_feed.feed.title, \
bgstack15