summaryrefslogtreecommitdiff
path: root/pgweb/mailqueue/admin.py
diff options
context:
space:
mode:
authorMagnus Hagander2014-01-11 11:33:06 +0000
committerMagnus Hagander2014-01-11 11:33:06 +0000
commit8f0b7e6b50f69196747cc3c564c304a3eb9f8c57 (patch)
tree222a930f038360bfdd09654eab496802755d6312 /pgweb/mailqueue/admin.py
parentc2b6d459e92db73d3b72379b0bae5d2ab224bfaf (diff)
Switch email sending go through a queue table in the database
Import the code from the PostgreSQL Europe website to handle this, since it's well proven by now. Any points that send email now just write them to the database using the functions in queuedmail.util. This means we can now submit notification emails and such things within transactions and have them properly roll bcak if something goes wrong (so no more incorrect notifications when there is a database error). These emails are picked up by a cronjob that runs frequently (typically once per minute or once every 2 minutes) that submits them to the local mailserver. By doing it out of line, this gives us a much better way of dealing with cases where mail delivery is really slow. The submission from the cronjob is now done with smtp to localhost instead of opening a pipe to the sendmail command - though this should have no major effects on anything. This also removes the setting SUPPRESS_NOTIFICATIONS, as no notifications are actually ever sent unless the cronjob is run. On development systems they will just go into the queuedmail table, and can be deleted from there.
Diffstat (limited to 'pgweb/mailqueue/admin.py')
-rw-r--r--pgweb/mailqueue/admin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pgweb/mailqueue/admin.py b/pgweb/mailqueue/admin.py
new file mode 100644
index 00000000..ccabb813
--- /dev/null
+++ b/pgweb/mailqueue/admin.py
@@ -0,0 +1,5 @@
+from django.contrib import admin
+
+from models import QueuedMail
+
+admin.site.register(QueuedMail)