<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Dear all,</p>
<p>I currently use the following rule to automatically sort email
into folders based on mailing lists:</p>
<p># split out the various list forms<br>
# Mailman & other lists using list-id<br>
if exists "list-id" {<br>
if header :regex "list-id" "<([a-z_0-9-]+)[.@]" {<br>
set :lower "listname" "${1}";<br>
fileinto :create "${listname}";<br>
} else {<br>
if header :regex "list-id" "^\\s*<?([a-z_0-9-]+)[.@]" {<br>
set :lower "listname" "${1}";<br>
fileinto :create "${listname}";<br>
} else {<br>
keep;<br>
}<br>
}<br>
stop;<br>
}</p>
<p>This works really nice.<br>
The only problem I have here is that it does use the ID, but not
the name and this can lead to strange folder names.<br>
If an email has e.g. the following header:<br>
</p>
<pre>List-Id: mfechner/ci-test <142.ci-test.mfechner.gitlab.fechner.net>
it moves the email to the folder 142 as the regex matches inside the <> string till the none-letter/none-number/_/- is matching.
I do not understand the expresion [.@] so it is nearly impossible for my to extend that query.
What I would like to do is using the ID as folder name as fallback.
So in this case I would like that the email is moved to folder `mfechner/ci-test`.
I'm not sure if sieve can handle the `/` correctly.
Thanks a lot for any tip.
</pre>
<pre class="moz-signature" cols="72">
Gruß
Matthias
--
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook
</pre>
</body>
</html>