1

Topic: ShadowAdress + Sieve

Hi,

I if send message user@example.net the sieve is works fine, but if I send a message surname.givenname@example.net the sieve is not work.


dn: mail=user@example.net,ou=Users,domainName=example.net,o=domains,dc=example,dc=net
accountstatus: active
enabledservice: mail
enabledservice: smtp
enabledservice: pop3
enabledservice: imap
enabledservice: deliver
enabledservice: forward
enabledservice: senderbcc
enabledservice: recipientbcc
enabledservice: managesieve
enabledservice: displayedInGlobalAddressBook
enabledservice: pop3secured
enabledservice: imapsecured
enabledservice: managesievesecured
enabledservice: smtpsecured
enabledservice: shadowaddress
enabledservice: initials
homedirectory: /MAIL/example.net/user/
mail: user@example.net
mailmessagestore: example.net/user/
objectclass: inetOrgPerson
objectclass: shadowAccount
objectclass: mailUser
objectclass: top
shadowaddress: surname.givenname@example.net


roundcube SieveRules file:

require ["copy","fileinto"];

# rule:[gmail]
if anyof (true)
{
        redirect :copy "user2@gmail.com";
        fileinto "INBOX";
}

----

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

2

Re: ShadowAdress + Sieve

Need some improvement in iRedMail with shadowAddress and dovecot per-user sieve_dir setting.

I will try to fix this later, don't forget to push me if i'm lazy. Thanks smile

3

Re: ShadowAdress + Sieve

Hi, zolikusz.

I tested this today, and it works for me. My testing LDIF data:

#
# User: www@
# With shadow address: www2@
#
dn: mail=www@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org
mail: www@a.cn
enabledservice: shadowaddress
shadowaddress: www2@a.cn
homedirectory: /var/vmail/vmail1/a.cn/w/ww/www/www-2010.04.25.17.42.51/
mailmessagestore: vmail1/a.cn/w/ww/www/www-2010.04.25.17.42.51/
[... SKIP OTHER ATTRS ...]

Sieve filter rule in /var/vmail/sieve/a.cn/www/dovecot.sieve (Copy of yours):

#
# Redirect mails to another account: www3@.
#
require ["copy","fileinto"];
# rule:[gmail]
if anyof (true)
{
        redirect :copy "www3@a.cn";
        fileinto "INBOX";
}

Send an email to www2@ (the shadow address) now:

$ echo "test mail body" | mail -s "test" www2@a.cn

Log content in /var/log/sieve (with 'mail_debug = yes' in /etc/dovecot.conf):

...
#
# ---- You see, it found and applied sieve filter rule of www@a.cn. ----
#
deliver(www@a.cn): May 11 18:50:01 Info: cmusieve: Using sieve path: /var/vmail/sieve/a.cn/www/dovecot.sieve
deliver(www@a.cn): May 11 18:50:01 Info: cmusieve: Executing script /var/vmail/sieve/a.cn/www/dovecot.sievec
deliver(www@a.cn): May 11 18:50:01 Info: Sending a forward to <www3@a.cn> with return path <root@r6.iredmail.org>
...
deliver(www@a.cn): May 11 18:50:01 Info: msgid=<20100511105001.4EA481D004F@r6.iredmail.org>: forwarded to <www3@a.cn>
...
deliver(www@a.cn): May 11 18:50:01 Info: msgid=<20100511105001.4EA481D004F@r6.iredmail.org>: saved mail to INBOX
deliver(www3@a.cn): May 11 18:50:01 Info: msgid=<20100511105001.4EA481D004F@r6.iredmail.org>: saved mail to INBOX

4

Re: ShadowAdress + Sieve

Hi,

I'm tested again and doesn't work. (Ubuntu 10.04)

If I send message to givenname.surname@ , the sieve try to use:

/MAIL/sieve/example.net/surname.givenname/dovecot.sieve  (shadowadress)

and not this:

/MAIL/sieve/example.net/user/dovecot.sieve  (mail)


The log:

Aug 03 14:36:07 deliver(user@example.net): Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
Aug 03 14:36:07 deliver(user@example.net): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so
Aug 03 14:36:07 deliver(user@example.net): Info: auth input: quota_rule=*:bytes=4294967296
Aug 03 14:36:07 deliver(user@example.net): Info: auth input: mail=maildir:~/example.net/user//Maildir/
Aug 03 14:36:07 deliver(user@example.net): Info: auth input: home=/MAIL
Aug 03 14:36:07 deliver(user@example.net): Info: maildir: data=~/example.net/user//Maildir/
Aug 03 14:36:07 deliver(user@example.net): Info: maildir++: root=/MAIL/example.net/user//Maildir, index=, control=, inbox=/MAIL/example.net/user//Maildir
Aug 03 14:36:07 deliver(user@example.net): Info: sieve: using sieve path for user's script: /MAIL/sieve/example.net/user/dovecot.sieve
Aug 03 14:36:07 deliver(user@example.net): Info: sieve: opening script /MAIL/sieve/example.net/user/dovecot.sieve
Aug 03 14:36:07 deliver(user@example.net): Info: sieve: executing compiled script /MAIL/sieve/example.net/user/dovecot.sieve
Aug 03 14:36:07 deliver(user@example.net): Info: Namespace : Using permissions from /MAIL/example.net/user//Maildir: mode=0700 gid=-1
Aug 03 14:36:07 deliver(user@example.net): Info: sieve: msgid=<4C580D31.90304@magexample.net>: forwarded to <zolikusz@magexample.net>
Aug 03 14:36:07 deliver(user@example.net): Info: sieve: msgid=<4C580D31.90304@magexample.net>: stored mail into mailbox 'INBOX'
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: Loading modules from directory: /usr/lib/dovecot/modules/lda
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: auth input: quota_rule=*:bytes=4294967296
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: auth input: mail=maildir:~/example.net/user//Maildir/
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: auth input: home=/MAIL
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: maildir: data=~/example.net/user//Maildir/
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: maildir++: root=/MAIL/example.net/user//Maildir,
index=, control=, inbox=/MAIL/example.net/user//Maildir
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: sieve: local script path /MAIL/sieve/example.net/
surname.givenname/dovecot.sieve doesn't exist (using global script path in stead)
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: sieve: using sieve path for user's script: /MAIL/sieve/dovecot.sieve
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: sieve: opening script /MAIL/sieve/dovecot.sieve
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: sieve: script file /MAIL/sieve/dovecot.sieve is missing
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: Namespace : Using permissions from /MAIL/example.net/user//Maildir: mode=0700 gid=-1
Aug 03 14:36:21 deliver(surname.givenname@example.net): Info: msgid=<4C580D40.20007@magexample.net>: saved mail to INBOX