Split out noreply sender address to separate config parameter
authorMagnus Hagander <magnus@hagander.net>
Wed, 27 Sep 2017 10:01:45 +0000 (12:01 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 27 Sep 2017 10:01:45 +0000 (12:01 +0200)
We want to use the noreply@ email address when sending out notifications
to addresses that have yet to be verified, since we can just ignore
bounces to those.

pgweb/account/views.py
pgweb/settings.py

index 3f4e3d9f2964b8a8a292e59e4829a83b8ab87699..c5310ed5fe67800d633c182ddd8395be0081018f 100644 (file)
@@ -157,7 +157,7 @@ def change_email(request):
                                                                         token=generate_random_token())
                        token.save()
 
-                       send_template_mail(settings.NOTIFICATION_FROM,
+                       send_template_mail(settings.NOREPLY_FROM,
                                                           form.cleaned_data['email'],
                                                           'Your postgresql.org community account',
                                                           'account/email_change_email.txt',
@@ -293,7 +293,7 @@ def signup(request):
                        log.info("Generated token {0} for user {1} from {2}".format(token, form.cleaned_data['username'], get_client_ip(request)))
 
                        # Generate an outgoing email
-                       send_template_mail(settings.NOTIFICATION_FROM,
+                       send_template_mail(settings.NOREPLY_FROM,
                                                           form.cleaned_data['email'],
                                                           'Your new postgresql.org community account',
                                                           'account/new_account_email.txt',
index 7187073e276d4a9d3b300b89b0a37bb528c6ff07..8d8758e4b843ad6c71c0cd9aeaf3bd97d99f149b 100644 (file)
@@ -161,6 +161,7 @@ YUM_JSON="/usr/local/pgweb/external/yum.json"
 STATIC_CHECKOUT="/usr/local/pgweb-static"              # Location of a checked out pgweb-static project
 NOTIFICATION_EMAIL="someone@example.com"               # Address to send notifications *to*
 NOTIFICATION_FROM="someone@example.com"                # Address to send notifications *from*
+NOREPLY_FROM="someone@example.com"                     # Address to send unverified messages from
 LISTSERVER_EMAIL="someone@example.com"                 # Address to majordomo
 BUGREPORT_EMAIL="someone@example.com"                  # Address to pgsql-bugs list
 DOCSREPORT_EMAIL="someone@example.com"                 # Address to pgsql-docs list