Open tanakakz-alpha opened 4 months ago
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!
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.
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.)
@tanakakz-alpha , your suggestion looks promising for me. If no objection for a few weeks, I'll submit a PR.
@tanakakz-alpha , Please play with the PR above at your leisure.
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.