Handling multiple topic tags in Subject lines
-
benny
- State changed from new to accepted
Do you know if “topic tag” is used in an RFC or something other semi-official documentation? I do like it better than “blob” which was taken from an RFC as far as I can recall :)
The
specifiers.plistfile is very tricky to change, but I think the following replacement of the subject parser would make “blob” into a multi-value header, but I cannot really recall where MailMate might assume that it's a single value:{ parsers = { subject = { header = "subject"; // Note the non-ASCII colon (\uFF1A - a full width colon) which is used by some Chinese messages. specifierRegexFormatString = '(?x) ^\s* # Whitespace ((?:\s*${MmSubjectPrefixRegexp}[::])+)? # Prefix including things like "Re: Re[5]:". \s* # Whitespace ((?:\[([^\[\]]+)\]\s*)+)? # Subject blob, e.g., "[TxMt]" \s* # Whitespace ((?:\s*${MmSubjectPrefixRegexp}[::])+)? # Prefix including things like "Re: Re[5]:". \s* # Whitespace (.*)$ # Subject body '; specifierCaptures = { 1 = { specifier = "prefix"; }; 2 = { specifier = "topics"; parsers = ( "topic" ); canBeImplicit = :true; }; 3 = { specifier = "prefix"; }; // 4 = { specifier = "blob"; }; 4 = { specifier = "body"; type="noTabs"; parsers = ( "words" ); }; }; }; topic = { specifierRegex = '\[([^\[\]]+)\]'; specifierCaptures = { 1 = { specifier = "blob"; }; }; }; }; }Let me know when and how it breaks and I'll see if I can eventually make this default behavior. And maybe use “topic” instead of “blob” as the specifier name.
-
benny
Quick update: Don't use the above as is. It doesn't work as well as I thought it would (leading to empty subject lines and even crashes).
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.