limite mail sending to 10 per minute and purge fail mail log

This commit is contained in:
bleizi 2024-09-05 19:48:54 +02:00
parent 21cbf2b21a
commit 0fbb19c5fd
No known key found for this signature in database
GPG Key ID: D46D7E3364433208
2 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ MAILTO=notekfet2020@lists.crans.org
* * * * * root cd /var/www/note_kfet && env/bin/python manage.py send_mail -c 1 -v 0 * * * * * root cd /var/www/note_kfet && env/bin/python manage.py send_mail -c 1 -v 0
* * * * * root cd /var/www/note_kfet && env/bin/python manage.py retry_deferred -c 1 -v 0 * * * * * root cd /var/www/note_kfet && env/bin/python manage.py retry_deferred -c 1 -v 0
00 0 * * * root cd /var/www/note_kfet && env/bin/python manage.py purge_mail_log 7 -v 0 00 0 * * * root cd /var/www/note_kfet && env/bin/python manage.py purge_mail_log 7 -v 0
00 0 * * * root cd /var/www/note_kfet && env/bin/python manage.py purge_mail_log -r failure 30 -v 0
# Faire une sauvegarde de la base de données # Faire une sauvegarde de la base de données
00 2 * * * root cd /var/www/note_kfet && apps/scripts/shell/backup_db 00 2 * * * root cd /var/www/note_kfet && apps/scripts/shell/backup_db
# Vérifier la cohérence de la base et mailer en cas de problème # Vérifier la cohérence de la base et mailer en cas de problème

View File

@ -225,6 +225,7 @@ MEDIA_URL = '/media/'
# Use mailer in production to place emails in a queue before sending them to avoid spam # Use mailer in production to place emails in a queue before sending them to avoid spam
EMAIL_BACKEND = 'mailer.backend.DbBackend' EMAIL_BACKEND = 'mailer.backend.DbBackend'
MAILER_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' MAILER_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
MAILER_EMAIL_MAX_BATCH = 10
EMAIL_USE_SSL = os.getenv('EMAIL_USE_SSL', False) EMAIL_USE_SSL = os.getenv('EMAIL_USE_SSL', False)
EMAIL_HOST = os.getenv('EMAIL_HOST', 'smtp.example.org') EMAIL_HOST = os.getenv('EMAIL_HOST', 'smtp.example.org')
EMAIL_PORT = os.getenv('EMAIL_PORT', 25) EMAIL_PORT = os.getenv('EMAIL_PORT', 25)