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

Allow "custom_subject" to always be at the beginning of the subject #1811

Open
tanakakz-alpha opened this issue Feb 29, 2024 · 5 comments · May be fixed by #1817
Open

Allow "custom_subject" to always be at the beginning of the subject #1811

tanakakz-alpha opened this issue Feb 29, 2024 · 5 comments · May be fixed by #1817

Comments

@tanakakz-alpha
Copy link

For example, if reply to an email with a subject like "[List 1] Subject", the mailer creates an email with a subject like "Re: [List 1] Subject".
If send this email to a mailing list, expect to receive an email with a subject like "[List 2] Re: Subject" or "[List 2] Re: [List 1] Subject".
However, the actual subject line will be something like "Re: [List 2] Subject.".
I would like a feature that allows "custom_subject" to always be at the beginning of the subject.

Expected Behavior

The subject of an email sent with "Re: [List 1] Subject" will be "[List 2] Re: Subject" or "[List 2] Re: [List 1] Subject".

Current Behavior

The subject of the email sent with "Re: [List 1] Subject" will be "Re: [List 2] Subject".

Possible Solution

Rather than replacing Custom_subject, remove it and prepend the new one.

Context

Automation using email subject line works correctly.

@ikedas
Copy link
Member

ikedas commented Feb 29, 2024

As far as I remember, the format of always prefixing the list tag was presented as an option when the custom_subject processing has been proposed at first. However, it turned out that very few users preferred that format, and only the current format was adopted.

This format is certainly unintuitive when used with sequence numbers [%list.sequence%], however, most sites do not include sequece numbers in the tags (Frankly, as far as I know, Japanese users are the only ones who prefer to identify messages by numbering their posts 😃).

Nevertheless, if there are use cases that would certainly require such a feature, we would appreciate it if someone could submit a PR!

@tanakakz-alpha
Copy link
Author

I am filtering emails based on the condition that the subject line starts with "[List ", my reply emails are sorted into an unexpected folder.
Another problem is that "Re: [List 1]" becomes "Re: [List 2]" and appears to be replying to "[List 2]" which does not exist.

@tanakakz-alpha
Copy link
Author

A particular problem is that setting "list.sequence" makes it appear as if you are replying to an email that contains a number that doesn't exist.
I tried to use message_hook, but it didn't work because there was a process that forced "Re:" in "TransformIncoming.pm" to be brought to the beginning.
This issue can be resolved by adding the following code to line 171 of "TransformIncoming.pm" (before $subject_field is determined from $before_tag and $after_tag):

        if ($list->{'admin'}{'custom_subject'} =~ /\[\%\s*list\.sequence\s*\%\]/) {
            $after_tag = $before_tag . $after_tag;
            $before_tag = '';
        }

It would be best to prepare setting values ​​and use them to control, but adding setting values ​​involves major changes and is not easy to implement.
I think the above is sufficient if you just want to fix an issue that looks weird when using "list.sequence".

(PR is difficult because I can't upload files to GitHub due to internal restrictions.)

@ikedas
Copy link
Member

ikedas commented Mar 17, 2024

@tanakakz-alpha , your suggestion looks promising for me. If no objection for a few weeks, I'll submit a PR.

@ikedas ikedas pinned this issue Mar 17, 2024
@ikedas ikedas changed the title I would like a feature that allows "custom_subject" to always be at the beginning of the subject. Allow "custom_subject" to always be at the beginning of the subject Mar 17, 2024
@ikedas
Copy link
Member

ikedas commented Mar 20, 2024

@tanakakz-alpha ,
Please play with the PR above at your leisure.

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

Successfully merging a pull request may close this issue.

2 participants