Ensure that local files are deleted after processing, and add some information about it to the install.rst documentation

This commit is contained in:
Garret Wassermann 2016-11-11 22:49:55 -05:00 committed by Jonathan Barratt
parent fc5e5180b0
commit 97a24fbe22
No known key found for this signature in database
GPG Key ID: BCBF01FBE07879DD
2 changed files with 8 additions and 1 deletions

View File

@ -102,3 +102,10 @@ Adding To Your Django Project
9. Load initial e-mail templates, otherwise you will not be able to send e-mail::
python manage.py loaddata emailtemplate.json
10. If you intend on using local mail directories for processing email into tickets, be sure to create the mail directory before adding it to the queue in the Django administrator interface. The default mail directory is ``/var/lib/mail/helpdesk/``. Ensure that the directory has appropriate permissions so that your Django/web server instance may read and write files from this directory.
Note that by default, any mail files placed in your local directory will be permanently deleted after being successfully processed. It is strongly recommended that you take further steps to save emails if you wish to retain backups.
Also, be aware that if a disk error occurs and the local file is not deleted, the mail may be processed multiple times and generate duplicate tickets until the file is removed. It is recommended to monitor log files for ERRORS when a file is unable to be deleted.

View File

@ -239,7 +239,7 @@ def process_queue(q, logger):
if ticket:
logger.info("Successfully processed message %s, ticket/comment created." % str(m))
try:
# unlink(m) #delete message file if ticket was successful
unlink(m) # delete message file if ticket was successful
logger.info("Successfully deleted message %s." % str(m))
except:
logger.error("Unable to delete message %s." % str(m))