1

Topic: Sieve on iRedMail 5 (CentOS)

Hello. I tried iRedMail script to install on CentOS 5.3. I installed with MySQL and both Roundcube and Squirrel. In both clients rules are not working - from log I see that sieve deliver the emais to inbox, ignoring the per-user script in /var/vmail/sieve/domain/user - i tryed with squirrel and roundcube (i see each client rewrite the link to its own script).

Not working neither from /var/vmail/sieve global script.

All lines in sieve.log say "saved mail to INBOX" even if rules should match and trigger a fileinto "Junk".



Best regards

Emidio

2

Re: Sieve on iRedMail 5 (CentOS)

Add below lines in /etc/dovecot.conf:

plugin {
    sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
}

It should work as expected.

I will add this fix in 0.5.1. Thanks for your feedback. smile

3

Re: Sieve on iRedMail 5 (CentOS)

Fixed: http://code.google.com/p/iredmail/sourc … 95797470b3
And sync the upgrade tutorial (0.5.0 -> 0.5.1): http://code.google.com/p/iredmail/wiki/Upgrade_050_051

Thanks smile

4

Re: Sieve on iRedMail 5 (CentOS)

Many thanks for the fix and the iRedMail Project. I go back playing with the installation smile
Have a nice day.

5 (edited by Caliban 2009-08-18 22:53:58)

Re: Sieve on iRedMail 5 (CentOS)

I am trying to get this to work as well. I'm using the vacation (Out of office) filter for testing if that makes a difference, but it won't work.

ZhangHuangbin wrote:
plugin {
    sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
}

Are you sure about this?  There is no such file. There is a /var/vmail/sieve/<domainname>/<username>/roundcube.sieve, which I tried to use to no avail, and there is a /var/vmail/vmail01/<domainname>/<u>/<us>/<use>/<usernamedatetime>/dovecot.sieve link that points to the first file... I have a feeling you meant to use that link, but I'm not sure how %Ln and %Ln expand, or how to have it point to that link..
I've been playing with this short of hardcoding the path to see if sieve actually works at all, which is what I may try next...

Update: I think I managed to get a little closer. The setting I used is:

plugin {
    sieve = %Lh/dovecot.sieve
}

Which, after a message is received, creates a dovecot.sievec file in the same directory (Looks like a binary, compiled version).  So at least I know it's doing *something*... However the vacation response is not being sent out...

6

Re: Sieve on iRedMail 5 (CentOS)

However the vacation response is not being sent out...

Did you send to the account which you used to send mail? From user01@ to user01@, if so, deliver program won't generate a vacation message.

7

Re: Sieve on iRedMail 5 (CentOS)

No, I used a different email address (different domain even).  I can find absolutely nothing in any log file that it is even trying to send out a message... mail.log, dovecot.log, sieve.log, they're all clean, an no mentioning of any outgoing mail...

8

Re: Sieve on iRedMail 5 (CentOS)

Hello. I tried iRedOS and IRedMail (5.0 with the small update 5.01). I installed with LDAP and Roundcube bat clients rules are not working.
From log I see that sieve deliver the emais to inbox only, ignoring the per user script in /var/vmail/sieve/domain/user.

Any suggestions?


Best regards

Sabbiolina.

9

Re: Sieve on iRedMail 5 (CentOS)

@Caliban, Fixed sieve issue on Debian:
http://code.google.com/p/iredmail/sourc … 19ec462931

Upgrade tutorial was updated:
http://code.google.com/p/iredmail/wiki/Upgrade_050_051

Thanks for your feedback and testing. smile

10

Re: Sieve on iRedMail 5 (CentOS)

Unfortunately, it's still not working.  The patch you provided still points to /var/vmail/sieve/%Ld/%Ln/dovecot.sieve, which does not exist.  I think it should either be /var/vmail/sieve/%Ld/%Ln/roundcube.sieve, but that's roundcube specific, or %Lh/dovecot.sieve, or maybe something else entirely. I'm still unsure how things expand, but %Lh/dovecot.sieve would be my guess.

But even with that, the scripts get "compiled" if that's the right word, but not executed. I also tried a filter to move emails into a folder, but it won't work...

11

Re: Sieve on iRedMail 5 (CentOS)

It works for me here.

Try to debug it yourself, steps:

- Enable debug in dovecot. Add 'mail_debug = yes' in /etc/dovecot.conf (RHEL/CentOS) or /etc/dovecot/dovecot.conf (Debian/Ubuntu):

mail_debug = yes

- Monitor /var/log/sieve.log with 'tail':

$ sudo tail -f /var/log/sieve.log

- Send mail to the testing account, and try to find out the root case in sieve.log.

12

Re: Sieve on iRedMail 5 (CentOS)

Thank you for your continued support Zhang, it's much appreciated!

Here's what I did:

  • Enabled debug as you suggested

  • In roundcube I created a folder "Gmail", and a filter to filter everything from "gmail.com" into this folder.

  • A "dovecot.sieve" link is created in my user folder (Folder where Maildir is) that points to "/var/vmail/sieve/mydomain.com/username/roundcube.sieve"

  • File looks like this:

require ["fileinto"];
# rule:[Gmail]
if anyof (address :contains "Sender" "gmail.com")
{
fileinto "Gmail";
}

Then patched /etc/dovecot/dovecot.conf to include:

plugin {
    sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
}

When I receive a message, this shows up in sieve.log:

deliver(username@mydomain.com): Aug 19 08:20:11 Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
deliver(username@mydomain.com): Aug 19 08:20:11 Info: Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so
deliver(username@mydomain.com): Aug 19 08:20:11 Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_cmusieve_plugin.so
deliver(username@mydomain.com): Aug 19 08:20:11 Info: auth input: home=/var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13/
[...] (Cut some long lines dealing with quota)
deliver(username@mydomain.com): Aug 19 08:20:11 Info: maildir:data=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir/:INDEX=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir/
deliver(username@mydomain.com): Aug 19 08:20:11 Info: maildir++: root=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir, index=, control=, inbox=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir

And then, as I expected, here's the kicker:

deliver(username@mydomain.com): Aug 19 08:20:11 Info: cmusieve: /var/vmail/sieve/mydomain.com/username/dovecot.sieve doesn't exist
deliver(username@mydomain.com): Aug 19 08:20:11 Info: cmusieve: Using sievepath: /var/vmail/sieve/dovecot.sieve
deliver(username@mydomain.com): Aug 19 08:20:11 Info: cmusieve: Script not found: /var/vmail/sieve/dovecot.sieve
deliver(username@mydomain.com): Aug 19 08:20:11 Info: msgid=<20090819132003.68C8520206C@mail.mydomain.com>: saved mail to INBOX

So, I changed /etc/dovecot/dovecot.conf to look like this:

plugin {
    #sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
    sieve = %Lh/dovecot.sieve
}

And sent the same email:

[...] (Skipped the first part since it's the same)
deliver(username@mydomain.com): Aug 19 08:26:15 Info: cmusieve: Using sieve path: /var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//dovecot.sieve
deliver(username@mydomain.com): Aug 19 08:26:15 Info: cmusieve: Executing script /var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//dovecot.sievec
deliver(username@mydomain.com): Aug 19 08:26:15 Info: msgid=<20090819132554.0911D202877@mail.mydomain.com>: saved mail to INBOX

Errors are gone, it even says it is executing the script, and yet it doesn't...

13

Re: Sieve on iRedMail 5 (CentOS)

After read your process, i found the upgrade tutorial is incorrect: I missed 'protocol managesieve {}'.
I updated it again, it should be correct now.

Please try it again:
http://code.google.com/p/iredmail/wiki/Upgrade_050_051

Sorry

14

Re: Sieve on iRedMail 5 (CentOS)

Aha! Now we're getting somewhere!  At first it was still not working, so I deleted the filters I had, and created a new one that just flags all messages it receives. That works like a charm!

However, saving emails to a different folder is still not working, and neither is the Out of Office responder (which is the main reason I would like to get this thing to work)  Where does it store who already received this response so it doesn't send it again within the set number of days?  Maybe the receiver is already flagged as such, and won't get the response again for who knows how long?

Thanks!
Peter

15

Re: Sieve on iRedMail 5 (CentOS)

Caliban wrote:

Where does it store who already received this response so it doesn't send it again within the set number of days?

Find it out in /var/log/sieve.log.

16

Re: Sieve on iRedMail 5 (CentOS)

ZhangHuangbin wrote:

Find it out in /var/log/sieve.log.

Hahaha.. I should have seen that coming:)  However, again, here's what my sieve log says after creating t out of office filter, and sending from an email address this server has never seen before:

deliver(username@mydomain.com): Aug 19 10:45:44 Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_cmusieve_plugin.so
deliver(username@mydomain.com): Aug 19 10:45:44 Info: auth input: home=/var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13/
deliver(username@mydomain.com): Aug 19 10:45:44 Info: auth input: quota_rule=*:bytes=104857600
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Quota root: name= backend=maildir args=
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Quota rule: root= mailbox=* bytes=104857600 messages=0
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Quota warning: bytes=89128960 (85%) messages=0 command=/usr/bin/dovecot-quota-warning.sh 85
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Quota warning: bytes=94371840 (90%) messages=0 command=/usr/bin/dovecot-quota-warning.sh 90
deliver(username@mydomain.com): Aug 19 10:45:44 Info: Quota warning: bytes=99614720 (95%) messages=0 command=/usr/bin/dovecot-quota-warning.sh 95
deliver(username@mydomain.com): Aug 19 10:45:44 Info: maildir: data=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir/:INDEX=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir/
deliver(username@mydomain.com): Aug 19 10:45:44 Info: maildir++: root=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir, index=, control=, inbox=//var/vmail/vmail01/mydomain.com/u/us/use/username-2009.08.17.08.51.13//Maildir
deliver(username@mydomain.com): Aug 19 10:45:44 Info: cmusieve: Using sieve path: /var/vmail/sieve/mydomain.com/username/dovecot.sieve
deliver(username@mydomain.com): Aug 19 10:45:44 Info: cmusieve: Executing script /var/vmail/sieve/mydomain.com/username/dovecot.sievec
deliver(username@mydomain.com): Aug 19 10:45:44 Info: msgid=<20090819154520.A984F20287E@storm.mydomain.com>: saved mail to INBOX

There's no mentioning of checking anywhere whether that email address is already listed or not... 

I'm really sorry to be a pain, but I want this to work so badly:)

Thanks,
Peter