1

Topic: sieve not sending mail

I have set up auto-response email in roundcube using sieve and relevant script. i have left the dovecot configurations as they were (iredmail 0.7.0). I have no erros when debugging dovecot and sieve log but the response email is not being sent


Info: sieve: using sieve path for user's script: /var/vmail/sieve/***/***i/dovecot.sieve
Jul 13 14:14:44 deliver(**): Info: sieve: opening script /var/vmail/sieve/***/***/dovecot.sieve
Jul 13 14:14:44 deliver(**): Info: sieve: executing compiled script /var/vmail/sieve/***/***/dovecot.sieve
Jul 13 14:14:44 deliver(**): Info: sieve: msgid=<4E1DA84F.1040907@**>: stored mail into mailbox 'INBOX'

sieve script:


require ["fileinto", "vacation"];
# Move spam to spam folder
if header :contains "X-Spam-Flag" "YES" {
  fileinto "spam";
  # Stop here so that we do not reply on spams
  stop;
}
if address :matches ["To", "Cc"] "**email address**" {
vacation
  # Reply at most once a day to a same sender
  :days 1
  :subject "Out of office reply"
"I'm out of office, please contact Joan Doe instead.
Best regards
John Doe";
}

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: sieve not sending mail

Did you try to turn on debug mode in Dovecot and monitor it?
Also, please post whole debug log instead of just some of them.

3

Re: sieve not sending mail

after enanbling mail_debug = yes and restarting dovecot, I am not getting any information from it when sending an email to an existing user account and expecting an autoresponse. Here is the sieve log:


Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib20_autocreate_plugin.so
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: auth input: mail=maildir:/var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09//Maildir/
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: auth input: home=/var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09/
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: auth input: quota_rule=*:bytes=0
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Quota root: name=user backend=dict args=:proxy::quotadict
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Quota rule: root=user mailbox=* bytes=0 messages=0
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Quota warning: bytes=0 (85%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 85
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Quota warning: bytes=0 (90%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 90
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Quota warning: bytes=0 (95%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 95
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: dict quota: user=dmitri@my.mail.server, uri=proxy::quotadict, noenforcing=0
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=1, subscriptions=yes
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: maildir: data=/var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09//Maildir/
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: maildir++: root=/var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09//Maildir, index=, control=, inbox=/var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09//Maildir
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Namespace: type=shared, prefix=Shared/%u/, sep=/, inbox=no, hidden=no, list=no, subscriptions=yes
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: shared: root=, index=, control=, inbox=
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: Namespace : Using permissions from /var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09//Maildir: mode=0750 gid=-1
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: dict quota: user=dmitri@my.mail.server, uri=proxy::quotadict, noenforcing=0
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: sieve: using sieve path for user's script: /var/vmail/sieve/my.mail.server/dmitri/dovecot.sieve
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: sieve: opening script /var/vmail/sieve/my.mail.server/dmitri/dovecot.sieve
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: sieve: executing compiled script /var/vmail/sieve/my.mail.server/dmitri/dovecot.sieve
Jul 14 08:26:23 deliver(dmitri@my.mail.server): Info: sieve: msgid=<4E1EA82C.7080101@another.domain.com>: stored mail into mailbox 'INBOX'

and here's dovecot -n


dovecot -n
# 1.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.27-xenU-4265-i386 i686 Ubuntu 10.04.2 LTS
log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps managesieve
listen(default): *
listen(imap): *
listen(pop3): *
listen(managesieve): 127.0.0.1:2000
ssl_ca_file: /etc/ssl/certs/iRedMail_CA.pem
ssl_cert_file: /etc/ssl/certs/iRedMail_CA.pem
ssl_key_file: /etc/ssl/private/iRedMail.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
first_valid_uid: 1001
last_valid_uid: 1001
mail_uid: 1001
mail_gid: 1002
mail_location: maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_debug: yes
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_process_size: 1024
mail_plugins(default): quota imap_quota autocreate
mail_plugins(imap): quota imap_quota autocreate
mail_plugins(pop3):
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
imap_client_workarounds(default): tb-extra-mailbox-sep
imap_client_workarounds(imap): tb-extra-mailbox-sep
imap_client_workarounds(pop3):
imap_client_workarounds(managesieve):
namespace:
  type: private
  separator: /
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: Shared/%%u/
  location: maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  list: children
  subscriptions: yes
lda:
  postmaster_address: root
  auth_socket_path: /var/run/dovecot/auth-master
  mail_plugins: sieve quota autocreate
  sieve_global_path: /var/vmail/sieve/dovecot.sieve
  log_path: /var/log/sieve.log
auth default:
  mechanisms: plain login
  default_realm: another.domain.com
  user: vmail
  passdb:
    driver: ldap
    args: /etc/dovecot/dovecot-ldap.conf
  userdb:
    driver: ldap
    args: /etc/dovecot/dovecot-ldap.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/dovecot-auth
      mode: 438
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 438
      user: vmail
      group: vmail
plugin:
  quota_warning: storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
  quota_warning2: storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
  quota_warning3: storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
  quota: dict:user::proxy::quotadict
  quota_rule: *:storage=0
  expire: Trash 7 Trash/* 7 Junk 30
  expire_dict: proxy::expire
  auth_socket_path: /var/run/dovecot/auth-master
  sieve: /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
  sieve_dir: /var/vmail/sieve/%Ld/%Ln/
  autocreate: INBOX
  autocreate2: Sent
  autocreate3: Trash
  autocreate4: Drafts
  autocreate5: Junk
  autosubscribe: INBOX
  autosubscribe2: Sent
  autosubscribe3: Trash
  autosubscribe4: Drafts
  autosubscribe5: Junk
  acl: vfile
  acl_shared_dict: proxy::acl
  sieve: /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
  sieve_dir: /var/vmail/sieve/%Ld/%Ln/
dict:
  expire: db:/var/lib/dovecot/expire/expire.db
  quotadict: mysql:/etc/dovecot/dovecot-used-quota.conf
  acl: mysql:/etc/dovecot/dovecot-share-folder.conf

thanks

Dmitri

4

Re: sieve not sending mail

Log and config files look fine. I have some questions for you:

- How did you create this vacation rule?
- Did you try other sieve rules? e.g. move mail to another folder.

5

Re: sieve not sending mail

ZhangHuangbin wrote:

Log and config files look fine. I have some questions for you:

- How did you create this vacation rule?
- Did you try other sieve rules? e.g. move mail to another folder.

I have tried two methods for creating the vacation rule:

1. via creating a new filter in roundcube
2. by using the exmaple (above) I found at http://wiki.dovecot.org/LDA/Sieve

You should also note that I have a slight problem with my mail config whereby i am using a domain alias for receiving and sending my mail. Whilst the mail domain is registered as mail.domain.com - i am sending and receiving emails under the alias user@domain.com

This has caused sieve to create rules in the folder /var/vmail/sieve/domain.com.user and I need to manually create and move the config files to /var/vmail/mail.domain.com/user as this is where sieve is looking for the script to execute...it finds my manually created config and processes it, but perhaps this is where the problem lies...

thanks

6

Re: sieve not sending mail

kromcuich wrote:

You should also note that I have a slight problem with my mail config whereby i am using a domain alias for receiving and sending my mail. Whilst the mail domain is registered as mail.domain.com - i am sending and receiving emails under the alias user@domain.com

That makes sense.
Seems we have to adjust LDAP/MySQL query to return per-user sieve_dir instead of hard-code it in dovecot.conf.
Will try to solve it later.

Thanks for your feedback. smile

7

Re: sieve not sending mail

That makes sense.
Seems we have to adjust LDAP/MySQL query to return per-user sieve_dir instead of hard-code it in dovecot.conf.
Will try to solve it later.

Thanks for your feedback. smile

ok, can you recommend any work around to a vacation style function/plugin - my users are demanding one promptly smile

thanks

D

8

Re: sieve not sending mail

kromcuich wrote:

can you recommend any work around to a vacation style function/plugin - my users are demanding one promptly smile

Note: PLEASE TEST IT IN A TESTING SERVER BEFORE APPLING ON PRODUCTION SERVER.

Try to change file location of sieve rules in dovecot.conf, like this:

# Original setting:
#sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
#sieve_dir =

# Modified:
sieve = /%Lh/sieve/dovecot.sieve
sieve_dir = /%Lh/sieve

With this new setting, file location of sieve rule (dovecot.sieve) will be /var/vmail/vmail1/my.mail.server/d/m/i/dmitri-2011.06.03.17.05.09/sieve/dovecot.sieve

Since accounts in alias domain will use same maildir path as primary domain, so it will return same value of '%Lh' (HOME), then it should work as expected.

9

Re: sieve not sending mail

Hi, I tried this and it didnt work. When the setting was changed, mail stopped arriving at the server:

Jul 29 18:00:31 cen postfix/smtpd[26011]: NOQUEUE: reject: RCPT from cpe-72-225-169-80.nyc.res.rr.com[72.225.169.80]: 553 5.7.1 <user@***>: Sender address rejected: not owned by user user@***; from=<user@***> to=<user2@***> proto=ESMTP helo=<[192.168.1.103]>

Note that my sieve rules are not created in the user's /Maildir but in /var/vmail/sieve/domain/user

Perhaps I can either punch in sieve rules manually per each domain (if you tell me how) or tell sieve where to store its rules (but then I'm not sure how to update this for all existing 150+ users)

Also

As an alternative, perhaps you can recommend which is the best way for the http://sourceforge.net/projects/rcubevacation/ plugin to connect to the server, once installed. As per their documentation:

Available drivers
------------------
The following drivers are available to do the low level work:
- Sieve. This driver uses ManagedSieve to set/get the Sieve script for sending mail.
- FTP. This driver uploads the .forward file to the user's homedirectory.
- SSHFTP. This driver uses SSH to upload .forward file to the user's homedirectory.
- Setuid. This driver places the .forward file in the user's homedirectory using
the squirrel setuid binary.
- SQL. This driver creates entries in the vacation table in a MySQL database and
modifies the alias table.
At the moment the SQL driver is tailored towards Postfix with either MySQL or PostgreSQL
but can be modified to suit other configurations.
- None. This driver disables the Vacation tab for hosts that do not support Out of office replies.

Since I cant get Sieve to work, maybe I could try do it with FTP?

10

Re: sieve not sending mail

kromcuich wrote:

Sender address rejected: not owned by user user@***

Reference:
http://iredmail.org/wiki/index.php?titl … domain.ltd

kromcuich wrote:

As an alternative, perhaps you can recommend which is the best way for the http://sourceforge.net/projects/rcubevacation/ plugin to connect to the server, once installed. As per their documentation:

Available drivers
------------------
The following drivers are available to do the low level work:
- Sieve. This driver uses ManagedSieve to set/get the Sieve script for sending mail.

iRedMail has managesieve service enabled by default, please refer to Roundcube plugin "plugins/managesieve/".

11

Re: sieve not sending mail

I`ve got the same problem using Iredmail 0.7.3 on Ubuntu 10.04 LTS.
Filters created in roundcube are ignored and all messages are stored in INBOX.

Logs (mail debug):

Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib20_autocreate_plugin.so
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: auth input: mail=maildir:/var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//Maildir/
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: auth input: home=/var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01/
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: auth input: quota_rule=*:bytes=0
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Quota root: name=user backend=dict args=:proxy::quotadict
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Quota rule: root=user mailbox=* bytes=0 messages=0
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Quota warning: bytes=0 (85%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 85
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Quota warning: bytes=0 (90%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 90
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Quota warning: bytes=0 (95%) messages=0 command=/usr/local/bin/dovecot-quota-warning.sh 95
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: dict quota: user=michal@XXXXXXXX.com, uri=proxy::quotadict, noenforcing=0
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=1, subscriptions=yes
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: maildir: data=/var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//Maildir/
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: maildir++: root=/var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//Maildir, index=, control=, inbox=/var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//Maildir
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Namespace: type=shared, prefix=Shared/%u/, sep=/, inbox=no, hidden=no, list=no, subscriptions=yes
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: shared: root=, index=, control=, inbox=
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: Namespace : Using permissions from /var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//Maildir: mode=0700 gid=-1
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: dict quota: user=michal@XXXXXXXX.com, uri=proxy::quotadict, noenforcing=0
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: sieve: using sieve path for user's script: //var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//sieve/dovecot.sieve
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: sieve: opening script //var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//sieve/dovecot.sieve
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: sieve: executing compiled script //var/vmail/vmail1/XXXXXXXX.com/m/i/c/michal-2011.12.07.11.02.01//sieve/dovecot.sieve
Dec 20 08:29:37 deliver(michal@XXXXXXXX.com): Info: sieve: msgid=<589d8102a361ba829498578676bd20b1@YYYYYYY.info>: stored mail into mailbox 'INBOX'



but GLOBAL sieve rule (insert SPAM messages into JUNK folder) works perfecty.

Dec 20 09:25:34 deliver(xxxxxxxx@yyyyyyyyy.com): Info: sieve: msgid=20111220152525@nm.ru>: stored mail into mailbox 'Junk'

What i did wrong?

12

Re: sieve not sending mail

Hi michnikkr,

Could you please create a new forum topic and clearly explain your issue?
It's not a goo idea to ask in other's topic, it makes us confused about what your issue exactly is.