mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
introduce email bounce address, follow up on #221
This commit is contained in:
parent
72320a0178
commit
b7583e8370
3 changed files with 4 additions and 2 deletions
|
@ -42,10 +42,10 @@ def send_welcome_email(user, application_required):
|
||||||
@celery.task
|
@celery.task
|
||||||
def send_async_email(subject, sender, recipients, text_body, html_body, reply_to):
|
def send_async_email(subject, sender, recipients, text_body, html_body, reply_to):
|
||||||
if 'ngrok.app' in sender: # for local development
|
if 'ngrok.app' in sender: # for local development
|
||||||
sender = f'{g.site.name} <{current_app.config["MAIL_FROM"]}>'
|
sender = 'PieFed <noreply@piefed.social'
|
||||||
return_path = 'bounces@piefed.social'
|
return_path = 'bounces@piefed.social'
|
||||||
else:
|
else:
|
||||||
return_path = 'bounces@' + current_app.config['SERVER_NAME']
|
return_path = current_app.config['BOUNCE_ADDRESS']
|
||||||
# NB email will not be sent if you have not verified your domain name as an 'Identity' inside AWS SES
|
# NB email will not be sent if you have not verified your domain name as an 'Identity' inside AWS SES
|
||||||
if type(recipients) == str:
|
if type(recipients) == str:
|
||||||
recipients = [recipients]
|
recipients = [recipients]
|
||||||
|
|
|
@ -38,6 +38,7 @@ class Config(object):
|
||||||
BOUNCE_HOST = os.environ.get('BOUNCE_HOST') or ''
|
BOUNCE_HOST = os.environ.get('BOUNCE_HOST') or ''
|
||||||
BOUNCE_USERNAME = os.environ.get('BOUNCE_USERNAME') or ''
|
BOUNCE_USERNAME = os.environ.get('BOUNCE_USERNAME') or ''
|
||||||
BOUNCE_PASSWORD = os.environ.get('BOUNCE_PASSWORD') or ''
|
BOUNCE_PASSWORD = os.environ.get('BOUNCE_PASSWORD') or ''
|
||||||
|
BOUNCE_ADDRESS = os.environ.get('BOUNCE_ADDRESS') or MAIL_FROM or ''
|
||||||
|
|
||||||
SENTRY_DSN = os.environ.get('SENTRY_DSN') or None
|
SENTRY_DSN = os.environ.get('SENTRY_DSN') or None
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ CACHE_REDIS_URL='redis://localhost:6379/1'
|
||||||
BOUNCE_HOST=''
|
BOUNCE_HOST=''
|
||||||
BOUNCE_USERNAME=''
|
BOUNCE_USERNAME=''
|
||||||
BOUNCE_PASSWORD=''
|
BOUNCE_PASSWORD=''
|
||||||
|
BOUNCE_ADDRESS=''
|
||||||
|
|
||||||
FLASK_APP = 'pyfedi.py'
|
FLASK_APP = 'pyfedi.py'
|
||||||
SENTRY_DSN = ''
|
SENTRY_DSN = ''
|
||||||
|
|
Loading…
Reference in a new issue