mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-09 08:05:13 +02:00
Add option to the EmailIgnore model to allow emails from an ignored address to be deleted (previous behaviour was to keep them all, so the mailbox could potentially become quite large - and every message was downloaded again every time the mailbox was checked). Upgrade instructions provided to both add the new database field and automatically switch to the old behaviour.
This commit is contained in:
@ -137,7 +137,11 @@ def ticket_from_message(message, queue):
|
||||
|
||||
for ignore in IgnoreEmail.objects.filter(Q(queues=queue) | Q(queues__isnull=True)):
|
||||
if ignore.test(sender_email):
|
||||
return False
|
||||
if ignore.keep_in_mailbox:
|
||||
# By returning 'False' the message will be kept in the mailbox,
|
||||
# and the 'True' will cause the message to be deleted.
|
||||
return False
|
||||
return True
|
||||
|
||||
regex = re.compile("^\[[A-Za-z0-9]+-\d+\]")
|
||||
if regex.match(subject):
|
||||
|
Reference in New Issue
Block a user