matching keywords in body is too strict
If a subscription writes an email to a schleuder list (main address) and it for example contains a line starting with
X-SOMETHING (e.g. because you forward an email in the body containing
X-PRIORITY: ) schleuder tries to match it to a plugin, but first complains about a missing
X-LISTNAME and never sends the mail to the list.
We should come up with a better strategy to match keywords.
- Ignore any empty/pure-whitespace lines at the beginning of the first plain_text_part message.
- If you match something
/^X\-.*/start matching for plugins, else abort.
- Once you matched a plugin, but you have a new non-empty/pure-whitespace line starting with something different than
/^X\-.*/abort looking for plugin names.
This would require the keywords to be at the beginning of a mail and as soon as the email begins with something else we would stop matching for plugin keywords.
Also when looking at https://0xacab.org/schleuder/schleuder/blob/master/lib/schleuder/mail/message.rb#L201-225 I think we are potentially loosing content once an email was longer than 1k lines, but contained a keyword. E.g. by resending an email longer than 1k lines. I did not verify that assumption.
Potentially, we could actually already match at Step 2 for valid plugin names, but this might require changing the plugin system, which might be something for another time.