[horde] Horde and Sieve

Arjen de Korte build+horde at de-korte.org
Wed Jun 13 20:50:34 UTC 2018


Citeren Andreas Mauser <andreas at mauser.info>:

> Hi,
> first, if I did not get all mails in the last days it's because  
> Telekom had major issues. So if you already answered, please forward  
> to me again. Many thanks.
>
> ----- Nachricht von Arjen de Korte <build+horde at de-korte.org> ---------
>  Datum: Mon, 11 Jun 2018 20:44:23 +0200
>    Von: Arjen de Korte <build+horde at de-korte.org>
> Betreff: Re: [horde] Horde and Sieve
>     An: horde at lists.horde.org
>
>
>> Citeren Andreas Mauser <andreas at mauser.info>:
>>
>>> Hi,
>>>
>>> does Sieve work with dovecot under Fedora?
>>
>> I wouldn't know why it shouldn't work.
>>
>>> I tried but failed.
>>
>> *What* did you try? Please post your  
>> 'ingo/config/backends.local.php' file here. If you don't have one,  
>> there is (part of) your problem.
>>
>>> Is there a docu somwhere I did not find till today? I cannot get  
>>> it to work.
>>
>> Did you manage to setup Sieve on Dovecot? Usually that is the hard  
>> part, the Horde part is easy.
>
> Summary
>
>
> At the moment I can activate scripts, but they dont do anything.
>
>
> I have in postfix/master.cf
>
> dovecot   unix  -       n       n       -       -       pipe
> flags=DRhu user=mail:mail argv=/usr/libexec/dovecot/dovecot-lda -f  
> ${sender} -d ${recipient}

I have nothing Dovecot related in postfix/master.cf.

> In postfix/main.cf
>
> virtual_transport = dovecot
> virtual_mailbox_domains = mauser.info
> dovecot_destination_recipient_limit = 1
> mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a  
> "$RECIPIENT"

The only thing related to Dovecot in postfix/main.cf is the following line

   mailbox_command = /usr/lib/dovecot/deliver

which is symlinked to

   /usr/lib/dovecot/deliver -> dovecot-lda

> In dovecot/conf.d/20-managesieve
>
> service managesieve-login {
>  inet_listener sieve {
>    port = 4190
>  }
> And a firewall port opened.

You seem to be able to connect to Dovecot fine, so this should be OK.

> In dovecot/conf.d/90-sieve
>
> sieve_extensions = +imapflags

I use the build-in defaults here. The only changed values from the  
defaults are

   sieve = file:~/sieve;active=~/.dovecot.sieve
   recipient_delimiter = +

I don't think either is relevant to you, as seem to be able to modify  
the script and see the changes, I assume that Dovecot is able to  
locate the script just fine.

What I'm missing in your configuration (or you just didn't mention it)  
is enabling sieve in dovecot/conf.d/15-lda like the following

protocol lda {
   # Space separated list of plugins to load (default is global mail_plugins).
   mail_plugins = $mail_plugins sieve
}

> I can see the script alter on the file system, when I alter it in the GUI.

This means the Horde configuration is fine.

> This is the backends.local.conf:
>
> /* Sieve Example */
> $backends['sieve'] = array(
>    // Disabled by default
>    'disabled' => false,
>    'transport' => array(
>        Ingo::RULE_ALL => array(
>            'driver' => 'timsieved',
>            'params' => array(
>                // NOTE: Ingo by default sends only the bare Horde username
>                // for authentication. Sieve servers generally need both the
>                // username and domain. See the 'transport_auth' hook for
>                // an example on how to change the Ingo default behavior.
>
>                // Hostname of the timsieved server
>                'hostspec' => '10.0.24.2',
>                // Login type of the server
>                'logintype' => 'PLAIN',
>                // Enable/disable TLS encryption
>                'usetls' => false,
>                // Port number of the timsieved server
>                'port' => 4190,
>                // Name of the sieve script
>                'scriptname' => 'ingo',
>                // Enable debugging. The sieve protocol communication is
>                // logged with the DEBUG level.
>                'debug' => false,
>            ),
> 	),
>    ),

Don't do this. It is hard to figure out what values you changed and is  
prone to errors when these arrays are ever extended upstream. Only  
override the values that need changes from the defaults like the  
following (which happens to be the actual contents of this file on my  
system, since Dovecot lives on the same system and connects through  
localhost)

<?php
$backends['imap']['disabled'] = true;
$backends['sieve']['disabled'] = false;
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['usetls'] = false;
$backends['sieve']['script'][Ingo::RULE_ALL]['params']['utf8'] = true;

> The maillog shows:
>
> Jun 13 22:04:06 mauser dovecot[9647]: lda(andreas):  
> msgid=<20180613200400.GB5147 at web.info>: saved mail to INBOX
> Jun 13 22:04:06 mauser postfix/local[9646]: A5A1F31473EE:  
> to=<me at mauser.info>, orig_to=<me at mauser.info>, relay=local,  
> delay=0.05, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent  
> (delivered to command: /usr/libexec/dovecot/dovecot-lda -f "$SENDER"  
> -a "$RECIPIENT")

You should see a line similar to the following indicating that Dovecot  
fired up sieve to process the incoming message

jun 13 22:07:48 mail dovecot[17298]:  
lda(arjen)<17298><5ollDpR5IVuSQwAAu4fZMQ>: sieve:  
msgid=<20180613220725.Horde.3AQcVPSyitpcUMDRAXZOpMs at post.mauser.info>:  
stored mail into mailbox 'Software.Horde'

I don't know if it is missing from your logs or you just didn't post it.

> Can you see whats missing so that Ingo using the script? Mails get  
> all deilvered to INBOX.

My educated guess is, the problem is in your Dovecot configuration.



More information about the horde mailing list