Skip to content

Commit

Permalink
Merge pull request #974 from passiv/master
Browse files Browse the repository at this point in the history
fix: strip extraneous whitespace characters that are returned in the Message-ID and In-Reply-To fields from some email providers
  • Loading branch information
gwasser committed Sep 23, 2021
2 parents f53ee13 + 6a0b367 commit 3216ff0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions helpdesk/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
message_id = message.get('Message-Id')
in_reply_to = message.get('In-Reply-To')

if message_id:
message_id = message_id.strip()

if in_reply_to:
in_reply_to = in_reply_to.strip()

if in_reply_to is not None:
try:
queryset = FollowUp.objects.filter(message_id=in_reply_to).order_by('-date')
Expand Down

0 comments on commit 3216ff0

Please sign in to comment.