<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Sieve &amp;mdash; sanifair.xyz</title>
    <link>https://blog.sanifair.xyz/tag:Sieve</link>
    <description>some Blog, about any</description>
    <pubDate>Wed, 30 Sep 2026 01:12:23 +0200</pubDate>
    <item>
      <title>Sieve Mailfilter - filter to folder</title>
      <link>https://blog.sanifair.xyz/sieve-mailfilter-filter-to-folder</link>
      <description>&lt;![CDATA[As allready wrote, #Sieve Mailfilter and how to have fun, today i show a sniped to filter Mails from whole Domains or single-Sender to a folder. !--more--&#xA;&#xA;split the TLD from E-Mail-Address&#xA;set Domain&#xA;if envelope :domain :matches &#34;from&#34; &#34;.&#34; {&#xA;  set :lower &#34;domain&#34; &#34;${1}-${2}&#34;;&#xA;}&#xA;With this Information we are able to the Domain for later use.&#xA;&#xA;split the localuser-Part and replace dots (.) by minus (-)&#xA;set from, replace . with -&#xA;if envelope :localpart :matches &#34;from&#34; &#34;..&#34; {&#xA;  set :lower &#34;localuser&#34; &#34;${1}-${2}-${3}&#34;;&#xA;}&#xA;elsif envelope :localpart :matches &#34;from&#34; &#34;.&#34; {&#xA;  set :lower &#34;localuser&#34; &#34;${1}-${2}&#34;;&#xA;}&#xA;elsif envelope :localpart :matches &#34;from&#34; &#34;&#34; {&#xA;  set :lower &#34;localuser&#34; &#34;${1}&#34;;&#xA;}&#xA;With this we have a localuser part&#xA;&#xA;at leased we try to find the right directory for the E-Mail to send in&#xA;domain in INBOX&#xA;if mailboxexists &#34;INBOX.${domain}&#34; {&#xA;  fileinto &#34;INBOX.${domain}&#34;;&#xA;  stop;&#xA;}&#xA;E-Mail in INBOX&#xA;if mailboxexists &#34;INBOX.${localuser}+${domain}&#34; {&#xA;  fileinto &#34;INBOX.${localuser}+${domain}&#34;;&#xA;  stop;&#xA;}&#xA;Notice: a Plus-Sign (+) will be used at At-Sign (@) in the folder-structure.&#xA;&#xA;In this example will all incoming mails sorted in Folder if there is a folder by Domain or fully sender Address in INBOX.&#xA;&#xA;Have fun ;)]]&gt;</description>
      <content:encoded><![CDATA[<p>As allready wrote, <a href="https://blog.sanifair.xyz/sieve-mailfiler-and-how-to-have-fun" rel="nofollow"><a href="https://blog.sanifair.xyz/tag:Sieve" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Sieve</span></a> Mailfilter and how to have fun</a>, today i show a sniped to filter Mails from whole Domains or single-Sender to a folder. </p>
<ol><li><p>split the TLD from E-Mail-Address</p>

<pre><code>#set Domain
if envelope :domain :matches &#34;from&#34; &#34;*.*&#34; {
set :lower &#34;domain&#34; &#34;${1}-${2}&#34;;
}
</code></pre>

<p>With this Information we are able to the Domain for later use.</p></li>

<li><p>split the localuser-Part and replace dots (.) by minus (–)</p>

<pre><code>#set from, replace . with -
if envelope :localpart :matches &#34;from&#34; &#34;*.*.*&#34; {
set :lower &#34;localuser&#34; &#34;${1}-${2}-${3}&#34;;
}
elsif envelope :localpart :matches &#34;from&#34; &#34;*.*&#34; {
set :lower &#34;localuser&#34; &#34;${1}-${2}&#34;;
}
elsif envelope :localpart :matches &#34;from&#34; &#34;*&#34; {
set :lower &#34;localuser&#34; &#34;${1}&#34;;
}
</code></pre>

<p>With this we have a localuser part</p></li>

<li><p>at leased we try to find the right directory for the E-Mail to send in</p>

<pre><code># domain in INBOX
if mailboxexists &#34;INBOX.${domain}&#34; {
fileinto &#34;INBOX.${domain}&#34;;
stop;
}
# E-Mail in INBOX
if mailboxexists &#34;INBOX.${localuser}+${domain}&#34; {
fileinto &#34;INBOX.${localuser}+${domain}&#34;;
stop;
}
</code></pre>

<p>Notice: a Plus-Sign (+) will be used at At-Sign (@) in the folder-structure.</p></li></ol>

<p>In this example will all incoming mails sorted in Folder if there is a folder by Domain or fully sender Address in INBOX.</p>

<p>Have fun ;)</p>
]]></content:encoded>
      <guid>https://blog.sanifair.xyz/sieve-mailfilter-filter-to-folder</guid>
      <pubDate>Sun, 15 Dec 2024 18:38:49 +0100</pubDate>
    </item>
    <item>
      <title>Sieve Mailfiler (and how to have fun)</title>
      <link>https://blog.sanifair.xyz/sieve-mailfiler-and-how-to-have-fun</link>
      <description>&lt;![CDATA[Sieve &#34;An Email Filtering Language&#34;, specified by RFC5228 [1].&#xA;&#xA;The Focus of #Sieve points to #simplicity, #independency and #expandability from access method or platform. Sieve-Scripts run already in the Process of #Mail delivery on #Server-Side. Sieve supports #Plugins, like #LDAP.&#xA;&#xA;!--more--&#xA;&#xA;Archiving Mails (like Mailinglists) by Date [2]:&#xA;require [&#34;variables&#34;,&#34;date&#34;,&#34;fileinto&#34;,&#34;mailbox&#34;];&#xA;&#xA;Extract date info&#xA;if currentdate :matches &#34;year&#34; &#34;&#34; { set &#34;year&#34; &#34;${1}&#34;; }&#xA;if currentdate :matches &#34;month&#34; &#34;&#34; { set &#34;month&#34; &#34;${1}&#34;; }&#xA;&#xA;Archive Dovecot mailing list items by year and month.&#xA;Create folder when it does not exist.&#xA;if header :is &#34;list-id&#34; &#34;dovecot.dovecot.org&#34; {&#xA;  fileinto :create &#34;INBOX.Lists.${year}.${month}.dovecot&#34;;&#xA;}&#xA;&#xA;Sort Mails by Sender&#xA;Mails from a mailing list will be put into the folder &#34;mailinglist&#34;&#xA;require &#34;copy&#34;;&#xA;require &#34;mailbox&#34;;&#xA;require &#34;imap4flags&#34;;&#xA;require &#34;fileinto&#34;;&#xA;if address :is [&#34;From&#34;, &#34;To&#34;] &#34;mailinglist@example.com&#34; {&#xA;  fileinto &#34;INBOX/mailinglist&#34;;&#xA;}&#xA;&#xA;And many, many, many more possibilitys for Mailbox-Filter 24.&#xA;&#xA;And there is a great Editor [6], too!&#xA;&#xA;Sieve Editor [6]&#xA;https://github.com/thsmi/sieve&#xA;&#xA;Sieve is a powerful scripting language for server-side mail filtering. It is intended to be used with IMAP which is ubiquitous. Many IMAP Servers are capable of running Sieve filters. Sieve stores and runs all scripts on the server-side.&#xA;&#xA;Now there is the dilemma – you have access to a server supporting Sieve but how do you manage your scripts on this server?&#xA;&#xA;You can use Telnet for this purpose, but that is far too uncomfortable, not applicable for a normal user and almost impossible with secure connections. Wouldn’t it be great to activate, edit, delete and add Sieve scripts with a convenient interface? That is exactly what this sieve editor offers…&#xA;&#xA;[1] https://www.rfc-editor.org/rfc/rfc5228&#xA;[2] https://doc.dovecot.org/configurationmanual/sieve/examples/#archiving-a-mailinglist-by-date&#xA;[3] https://en.wikipedia.org/wiki/Sieve(mailfilteringlanguage)&#xA;[4] https://p5r.uk/blog/2011/sieve-tutorial.html&#xA;[5] https://support.tigertech.net/sieve&#xA;[6] https://github.com/thsmi/sieve#sieve-editor]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="https://blog.sanifair.xyz/tag:Sieve" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Sieve</span></a> “An Email Filtering Language”, specified by RFC5228 [1].</p>

<p>The Focus of <a href="https://blog.sanifair.xyz/tag:Sieve" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Sieve</span></a> points to <a href="https://blog.sanifair.xyz/tag:simplicity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">simplicity</span></a>, <a href="https://blog.sanifair.xyz/tag:independency" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">independency</span></a> and <a href="https://blog.sanifair.xyz/tag:expandability" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">expandability</span></a> from access method or platform. Sieve-Scripts run already in the Process of <a href="https://blog.sanifair.xyz/tag:Mail" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Mail</span></a> delivery on <a href="https://blog.sanifair.xyz/tag:Server" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Server</span></a>-Side. Sieve supports <a href="https://blog.sanifair.xyz/tag:Plugins" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Plugins</span></a>, like <a href="https://blog.sanifair.xyz/tag:LDAP" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">LDAP</span></a>.</p>



<h4 id="archiving-mails-like-mailinglists-by-date-2" id="archiving-mails-like-mailinglists-by-date-2">Archiving Mails (like Mailinglists) by Date [2]:</h4>

<pre><code class="language-sieve">require [&#34;variables&#34;,&#34;date&#34;,&#34;fileinto&#34;,&#34;mailbox&#34;];

# Extract date info
if currentdate :matches &#34;year&#34; &#34;*&#34; { set &#34;year&#34; &#34;${1}&#34;; }
if currentdate :matches &#34;month&#34; &#34;*&#34; { set &#34;month&#34; &#34;${1}&#34;; }

# Archive Dovecot mailing list items by year and month.
# Create folder when it does not exist.
if header :is &#34;list-id&#34; &#34;dovecot.dovecot.org&#34; {
  fileinto :create &#34;INBOX.Lists.${year}.${month}.dovecot&#34;;
}
</code></pre>

<h4 id="sort-mails-by-sender" id="sort-mails-by-sender">Sort Mails by Sender</h4>

<pre><code class="language-sieve"># Mails from a mailing list will be put into the folder &#34;mailinglist&#34;
require &#34;copy&#34;;
require &#34;mailbox&#34;;
require &#34;imap4flags&#34;;
require &#34;fileinto&#34;;
if address :is [&#34;From&#34;, &#34;To&#34;] &#34;mailinglist@example.com&#34; {
  fileinto &#34;INBOX/mailinglist&#34;;
}
</code></pre>

<p>And many, many, many more possibilitys for Mailbox-Filter [2][3][4][5].</p>

<p>And there is a great Editor [6], too!</p>

<h4 id="sieve-editor-6" id="sieve-editor-6">Sieve Editor [6]</h4>

<p><a href="https://github.com/thsmi/sieve" rel="nofollow">https://github.com/thsmi/sieve</a></p>

<pre><code>Sieve is a powerful scripting language for server-side mail filtering. It is intended to be used with IMAP which is ubiquitous. Many IMAP Servers are capable of running Sieve filters. Sieve stores and runs all scripts on the server-side.

Now there is the dilemma – you have access to a server supporting Sieve but how do you manage your scripts on this server?

You can use Telnet for this purpose, but that is far too uncomfortable, not applicable for a normal user and almost impossible with secure connections. Wouldn’t it be great to activate, edit, delete and add Sieve scripts with a convenient interface? That is exactly what this sieve editor offers…
</code></pre>

<p>[1] <a href="https://www.rfc-editor.org/rfc/rfc5228" rel="nofollow">https://www.rfc-editor.org/rfc/rfc5228</a>
[2] <a href="https://doc.dovecot.org/configuration_manual/sieve/examples/#archiving-a-mailinglist-by-date" rel="nofollow">https://doc.dovecot.org/configuration_manual/sieve/examples/#archiving-a-mailinglist-by-date</a>
[3] <a href="https://en.wikipedia.org/wiki/Sieve_(mail_filtering_language" rel="nofollow">https://en.wikipedia.org/wiki/Sieve_(mail_filtering_language</a>)
[4] <a href="https://p5r.uk/blog/2011/sieve-tutorial.html" rel="nofollow">https://p5r.uk/blog/2011/sieve-tutorial.html</a>
[5] <a href="https://support.tigertech.net/sieve" rel="nofollow">https://support.tigertech.net/sieve</a>
[6] <a href="https://github.com/thsmi/sieve#sieve-editor" rel="nofollow">https://github.com/thsmi/sieve#sieve-editor</a></p>
]]></content:encoded>
      <guid>https://blog.sanifair.xyz/sieve-mailfiler-and-how-to-have-fun</guid>
      <pubDate>Thu, 11 May 2023 10:33:35 +0200</pubDate>
    </item>
  </channel>
</rss>