Patch #17705

MailHandler should ignore bogus issue strings [some-string#1234] in subject

Added by Felix Schäfer almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Felix Schäfer% Done:

0%

Category:Email receiving
Target version:2.6.1

Description

Currently the mail handler will try to parse anything that remotely resembles square brackets containing a hash followed by a number, whatever else happens to be in front of the hash in the brackets. This leads the mail handler to try to parse things like:

[12345678901234567890#1234]

and

[some-string#1234]
used by other systems.

The proposed patch Requires the hash to be either preceded by the opening bracket [ or a space.

better_incoming_email_issue_id_recognition.patch Magnifier (489 Bytes) Felix Schäfer, 2014-08-18 09:35

better_incoming_email_issue_id_recognition_with_tests.patch Magnifier (5.91 KB) Felix Schäfer, 2014-09-25 19:52

Associated revisions

Revision 13593
Added by Jean-Philippe Lang over 3 years ago

Ignore bogus issue strings like [some-string#1234] in email subjects (#17705).

History

#1 Updated by Jean-Baptiste Barth almost 4 years ago

No problem merging that as long as it has some more tests for failing strings we introduce... and for good ones too, as I can't find tests in test/unit/mail_handler_test.rb. Maybe it's time to refactor the logic in MailHandler#dispatch too. Felix: can you handle that ? Thanks!

#2 Updated by Felix Schäfer almost 4 years ago

Jean-Baptiste Barth wrote:

No problem merging that as long as it has some more tests for failing strings we introduce... and for good ones too, as I can't find tests in test/unit/mail_handler_test.rb.

Sure, can you assign it back to me so that I can remember it? Thanks :-)

Maybe it's time to refactor the logic in MailHandler#dispatch too.

I'll see about that, but I guess it's out of scope for this ticket.

#3 Updated by Jean-Baptiste Barth almost 4 years ago

  • Assignee set to Felix Schäfer

Here we go!

#4 Updated by Felix Schäfer almost 4 years ago

Jean-Baptiste, there's already tests for good strings of sorts with the test that try to import emails and make sure they've been imported correctly. I fear the best I can do would be to provide 1 or 2 examples of incoming emails that should fail, or even with bad and good strings pointing to different issues.

#5 Updated by Felix Schäfer almost 4 years ago

Here's a patch with 2 test-emails containing subjects with strings we don't want to match anymore pointing to the wrong issue and strings we want to match pointing to the right one.

#6 Updated by Frank Paaske over 3 years ago

Is this planned to be included in a release soon? I think this would make the email integration with OTRS much simpler!

#7 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from Improve incoming email issue subject recognition to MailHandler should ignore bogus issue strings [some-string#1234] in subject
  • Status changed from New to Resolved
  • Target version set to 2.6.1

Fix committed in r13593 with tests edited, thanks.

#8 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF