warn about incorrect notification backends, fix #95
SMTP is now also recognized as `smtp`backend. You may use multiple notification backends (separated by comma). Defaults to `stdout`.
This commit is contained in:
parent
8cf9ea348e
commit
fd8465eb1c
@ -43,7 +43,7 @@ session key and hostname. Here are the default values for this section:
|
|||||||
name =
|
name =
|
||||||
host =
|
host =
|
||||||
max-age = 15m
|
max-age = 15m
|
||||||
notify =
|
notify = stdout
|
||||||
|
|
||||||
dbpath
|
dbpath
|
||||||
file location to the SQLite3 database, highly recommended to change this
|
file location to the SQLite3 database, highly recommended to change this
|
||||||
@ -76,8 +76,15 @@ max-age
|
|||||||
:ref:`Appendum: Timedelta <appendum-timedelta>` for valid values.
|
:ref:`Appendum: Timedelta <appendum-timedelta>` for valid values.
|
||||||
|
|
||||||
notify
|
notify
|
||||||
Select notification backend for new comments. Currently, only SMTP
|
Select notification backend(s) for new comments, separated by comma.
|
||||||
is available.
|
Available backends:
|
||||||
|
|
||||||
|
stdout :
|
||||||
|
Log to standard output. Default, if none selected.
|
||||||
|
|
||||||
|
smtp :
|
||||||
|
Send notifications via SMTP on new comments with activation (if
|
||||||
|
moderated) and deletion links.
|
||||||
|
|
||||||
|
|
||||||
.. _CORS: https://developer.mozilla.org/en/docs/HTTP/Access_control_CORS
|
.. _CORS: https://developer.mozilla.org/en/docs/HTTP/Access_control_CORS
|
||||||
|
@ -92,10 +92,13 @@ class Isso(object):
|
|||||||
super(Isso, self).__init__(conf)
|
super(Isso, self).__init__(conf)
|
||||||
|
|
||||||
subscribers = []
|
subscribers = []
|
||||||
|
for backend in conf.getlist("general", "notify"):
|
||||||
|
if backend == "stdout":
|
||||||
subscribers.append(Stdout(None))
|
subscribers.append(Stdout(None))
|
||||||
|
elif backend in ("smtp", "SMTP"):
|
||||||
if conf.get("general", "notify") == "smtp":
|
|
||||||
subscribers.append(SMTP(self))
|
subscribers.append(SMTP(self))
|
||||||
|
else:
|
||||||
|
logger.warn("unknown notification backend '%s'", backend)
|
||||||
|
|
||||||
self.signal = ext.Signal(*subscribers)
|
self.signal = ext.Signal(*subscribers)
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class Config:
|
|||||||
"dbpath = /tmp/isso.db",
|
"dbpath = /tmp/isso.db",
|
||||||
"host = ",
|
"host = ",
|
||||||
"max-age = 15m",
|
"max-age = 15m",
|
||||||
"notify = ",
|
"notify = stdout",
|
||||||
"[moderation]",
|
"[moderation]",
|
||||||
"enabled = false",
|
"enabled = false",
|
||||||
"purge-after = 30d",
|
"purge-after = 30d",
|
||||||
|
Loading…
Reference in New Issue
Block a user