<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>Thank you for your answer.</p>
<p>That's what I tried at first, but got error message from the
editor (tb60+sieve)</p>
<p>Seems to be ok now.</p>
<p>Thanks for the help, I tried<b> mailboxexists("xxx")</b> instead
of<b> mailboxexists "xxx"</b> which I did not find as such n the
doc.</p>
<p>Cheers<br>
</p>
<div class="moz-cite-prefix">On 2/28/19 11:37 AM, Martin Johannes
Dauser via dovecot wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1551350259.2767.1.camel@cs.sbg.ac.at">
<pre class="moz-quote-pre" wrap="">What about extension "mailbox"?
<a class="moz-txt-link-freetext" href="https://wiki.dovecot.org/Pigeonhole/Sieve">https://wiki.dovecot.org/Pigeonhole/Sieve</a>
<a class="moz-txt-link-freetext" href="https://tools.ietf.org/html/rfc5490#section-3">https://tools.ietf.org/html/rfc5490#section-3</a>
A simple example (not tested, but should work):
note:
+ I use '/' instead of '.' as hierarchical separator
+ stop; stops the whole script, but you could use elsif instead.
require ["fileinto", "mailbox"];
if header :contains "header's name" "aaa" {
if mailboxexists "INBOX/aaa" {
fileinto "INBOX/aaa";
stop;
}
}
if header :contains "header's name" "def" {
if mailboxexists "INBOX/def" {
fileinto "INBOX/def";
stop;
}
}
Greetings Martin
On Thu, 2019-02-28 at 10:42 +0100, AvV via dovecot wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Dear All,
Thanks ofr the great job so far.
I have crawled the doc & web, and did not find oh to check for the
presence of a folder ina a mailbox?
I know about "fileinto :create" of course, but the purpose is
slightly
different: I want to automate the move into a folder based on some
rules
but *only if* an associated folder is present (which name is based
on
the rule), otherwise I will do a form of catch-all.
Example:
- INBOX
+- abc
+- def
- Rule detects "aaa" in someheader field: folder "aaa" not present"
->
continue;
- Rule detect "def" in some header field: "def exists" -> fileinto
"def"
; stop;
Any help appreciated.
Cheers,
A/
</pre>
</blockquote>
</blockquote>
</body>
</html>