<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sysbliss Blog &#187; linux</title>
	<atom:link href="http://blog.sysbliss.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sysbliss.com</link>
	<description>On the never-ending quest for systems bliss</description>
	<lastBuildDate>Wed, 20 Jan 2010 20:44:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Managing Dovecot Sieve scripts with Horde-Ingo</title>
		<link>http://blog.sysbliss.com/linux/managing-dovecot-sieve-scripts-with-horde-ingo.html</link>
		<comments>http://blog.sysbliss.com/linux/managing-dovecot-sieve-scripts-with-horde-ingo.html#comments</comments>
		<pubDate>Thu, 19 Jun 2008 20:14:45 +0000</pubDate>
		<dc:creator>jdoklovic</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.sysbliss.com/?p=6</guid>
		<description><![CDATA[I finally got around to getting sieve working with dovecot which was pretty easy. Next, I wanted to be able to manage the sieve rules via the Horde-Ingo webmail interface. This seemed like it should be an easy and common thing to do, however, it ended up taking a couple of days to sift through [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to getting sieve working with dovecot which was pretty easy. Next, I wanted to be able to manage the sieve rules via the Horde-Ingo webmail interface. This seemed like it should be an easy and common thing to do, however, it ended up taking a couple of days to sift through the rather poor hored/ingo docs, email back and forth on the mailing list, and do a lot of trial and error. (mostly error).</p>
<p>Finally, I found a solution that works&#8230;.  here it is (Assuming you already have dovecot-sieve working):</p>
<h3>Software:</h3>
<p>Debian etch<br />
Dovecot 1.0.13 (with dovecot common)<br />
Horde 3.2-RC2<br />
Ingo 1.2-RC2</p>
<h3>Step 1: Setup proper permissions</h3>
<p>For Ingo to be able to write out sieve scripts, the apache user needs permissions to write to the Maildir folders.<br />
I did this by simply adding the www-data user to the vmail group.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:<span style="color: #666666; font-style: italic;"># adduser www-data vmail</span>
:<span style="color: #666666; font-style: italic;"># /etc/init.d/apache2 restart</span></pre></div></div>

<p>This will give www-data permissions to write to the Maildir folders (owned by vmail:vmail) but if we just let Ingo create the scripts from scratch, they will be owned by www-data:www-data and vmail won&#8217;t be able to use them.</p>
<p>To correct this, just make sure you create an empty .dovecot.sieve when the user&#8217;s Maildir folder is created.</p>
<p>I handled this by adding:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> $<span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span>Maildir<span style="color: #000000; font-weight: bold;">/</span>.dovecot.sieve</pre></div></div>

<p>to my /usr/bin/maildirmake script.</p>
<h3>Step 2: Setup Ingo Backend</h3>
<p>In the horde/ingo/config directory, there is a file called backends.php. This file by default contains a bunch of different entries that tell Ingo how to store the mail filters.</p>
<p>For Ingo to actually work, there should only be one entry in this file (as I&#8217;m told). So for starters, just delete all of the entries in this file.</p>
<p>Now that we have a clean backends.php, we need to add an entry to tell Ingo where and how to save our .dovecot.sieve scripts.</p>
<p>There are many options for storage but the simplest for our purposes is to just use the filesystem.<br />
To enable this, add the following entry to the file</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$backends</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dovecot'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'driver'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'vfs'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'hordeauth'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'params'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'filename'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'.dovecot.sieve'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'vfsroot'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'/var/vmail'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'vfs_path'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'/example.com/%u/Maildir'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'vfstype'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'file'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'script'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'sieve'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'scriptparams'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This should all be pretty self-explanatory, but you&#8217;ll notice on line 7, we&#8217;re hardcoding the domain. This is because Ingo will expand %u as the user, but it does not currently expand any variable as the domain. (i.e. %d)</p>
<p><a title="domain workaround" href="http://blog.sysbliss.com/linux/managing-dovecot-sieve-scripts-with-horde-ingo.html#comment-161">See Domain Workaround Below</a></p>
<p>That&#8217;s it. If you now log into horde and create/edit filters, they should be saved to the .dovecot.sieve file in the user&#8217;s Maildir.  Pretty simple, and now documented.  <img src='http://blog.sysbliss.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sysbliss.com/linux/managing-dovecot-sieve-scripts-with-horde-ingo.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
