Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR - Recognize more prefixes (Re, AW, SV, …) when cleaning subjects #19

Open
uschwarz opened this issue Apr 19, 2021 · 2 comments
Open

Comments

@uschwarz
Copy link

uschwarz commented Apr 19, 2021

Environment

  • OS: any
  • Browser: any
  • Znuny version: 6.0.33

Expected behaviour

When cleaning subjects (i.e., removing all errant Re:, Fwd:, etc. before replying), Outlook's non-standard prefixes like AW:, WG: should be removed as well, i.e. a reply to a message with subject "AW: [Ticket#...] Re: AW: Re: test" should be "Re: [Ticket#] test".

Actual behaviour

Only the prefixes that Znuny would use itself, i.e. as configured in Ticket::SubjectRe and Ticket::SubjectFwd are removed, leaving all others behind. In above example, the reply would be something like "Re: [Ticket#] AW: AW: test" or "AW: [Ticket#] Re: Re: test"

How to reproduce

Steps to reproduce the behavior:

  1. Create an outgoing email ticket.
  2. Reply, in mail client, to ticket. Add a couple of Re: and AW: to the subject to pretend you've been mailing back and forth between a German Outlook installation using "AW:" and a RFC-compliant client using "Re:".
  3. Reply to this reply in OTRS
  4. See what the subject line is like.

Additional information

I've tried a local patch: in Kernel/System/Ticket.pm, function TicketSubjectClean, I've changed to:

    # remove leading number with configured "RE:\s" or "RE[\d+]:\s" e. g. "RE: " or "RE[4]: "
    #$Subject =~ s/^($TicketSubjectRe(\[\d+\])?:\s)+//i;
    # hotpatch 20210414 ums: Outlook generates language variations.
    $Subject =~ s/^((Re|SV|Antw|VS|REF|AW|RIF|SV|BLS|RES|Odp|YNT|ATB)(\[\d+\])?:\s)+//i;

    # remove leading number with configured "Fwd:\s" or "Fwd[\d+]:\s" e. g. "Fwd: " or "Fwd[4]: "
    #$Subject =~ s/^($TicketSubjectFwd(\[\d+\])?:\s)+//i;
    # hotpatch 20210414 ums: Outlook generates language variations.
    $Subject =~ s/^((Fwd|VS|Doorst|VL|TR|WG|FS|TRS|VB|RV|ENC|PD|ILT|YML)(\[\d+\])?:\s)+//i;


going on a list from https://en.wikipedia.org/wiki/List_of_email_subject_abbreviations#Abbreviations_in_other_languages
(though I couldn't be bothered to include and test the more UTF8y prefixes). I don't have enough Znuny-fu to figure out if this could be put into an extension. Maybe it should be user-configurable? The hard-coded values above are just a "works-for-me".

@rkaldung
Copy link
Member

Hi @uschwarz,

Thank you for this idea. Since the 6.0.x branch is marked as a long term branch I'd like to keep this for the upcoming feature branch. And of course, this setting should be a configuration.

Implementing this for 6.0 as an add-on might be possible by overloading the TicketSubjectClean() of Ticket.pm, but we have our hands full. Maybe someone in the community like to volunteer for this?

@ikedas
Copy link

ikedas commented May 16, 2023

I submitted a PR: Centuran/OTRS-Community-Edition#20 that is applicable to Znuny & OTOBO. Should I submit it also here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants