[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination

Aleksandar Lazic al-dovecot at none.at
Mon Sep 12 20:14:48 EEST 2011


Dear Listmember.

I resend this with different Subject so that the spamfilter does not
drop the mail, I hope ;-)

I try to migrate from my current courier-mta setup fo postfix dovecot
setup.

I use the following scirpt to filter to the destination mailbox.

### /var/vmail/none.at/al/.dovecot.sieve
# from http://wiki.dovecot.org/LDA/Sieve
require ["fileinto", "envelope", "subaddress", "include"];

include "lists.sieve";

if envelope :detail "to" "work" {
   fileinto "INBOX.work";
}
###

### /var/vmail/none.at/al/sieve/lists.sieve
require ["fileinto", "subaddress", "envelope" ];

if envelope :detail "to" "pdnsusers" {
      fileinto "Lists.pdnsusers";
}
###

postfix/master

###
dovecot   unix  -       n       n       -       -       pipe
   flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender}
   -d ${user}@${nexthop} -a ${original_recipient}
#  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
${sender} -d ${user}@${nexthop} -m ${extension} -a ${original_recipient}
###

Log
###
Sep 11 21:47:48 lvps46-163-74-15 postfix/smtpd[7788]: connect from

Sep 11 21:48:12 lvps46-163-74-15 postfix/smtpd[7788]: 495EF9FECAF9:

Sep 11 21:48:27 lvps46-163-74-15 postfix/cleanup[7795]: 495EF9FECAF9:
message-id=<>
Sep 11 21:48:27 lvps46-163-74-15 postfix/qmgr[7785]: 495EF9FECAF9:
from=<al at bitrace.net>, size=268, nrcpt=1 (queue active)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: Loading modules
from directory: /usr/lib/dovecot/modules
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: Module loaded:
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: auth input:
al at none.at uid=5000 gid=5000 home=/var/vmail/none.at/al
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug:
Effective uid=5000, gid=5000, home=/var/vmail/none.at/al
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug:
maildir: root exists (/var/vmail/none.at/al/Maildir)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug:
maildir++: root=/var/vmail/none.at/al/Maildir, index=, control=,
inbox=/var/vmail/none.at/al/Maildir, alt=
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: none:
root=, index=, control=, inbox=, alt=
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug:
Destination address: al-pdnsuser at none.at (source: -a parameter)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: sieve:
using sieve path for user's script: /var/vmail/none.at/al/.dovecot.sieve
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: sieve:
opening script /var/vmail/none.at/al/.dovecot.sieve
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: sieve:
script binary /var/vmail/none.at/al/.dovecot.svbin successfully loaded
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: sieve:
binary save: not saving binary /var/vmail/none.at/al/.dovecot.svbin,
because it is already stored
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): Debug: sieve:
executing script from /var/vmail/none.at/al/.dovecot.svbin
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al at none.at): sieve:
msgid=unspecified: stored mail into mailbox 'INBOX'
Sep 11 21:48:27 lvps46-163-74-15 postfix/pipe[7797]: 495EF9FECAF9:
to=<al-pdnsuser at none.at>, relay=dovecot, delay=28,
delays=28/0.02/0/0.22, dsn=2.0.0, status=sent (delivered via dovecot
service)
Sep 11 21:48:27 lvps46-163-74-15 postfix/qmgr[7785]: 495EF9FECAF9:
removed
Sep 11 21:48:28 lvps46-163-74-15 postfix/smtpd[7788]: disconnect from
xxx
###

dovecot -n => attachment dovecot_-n

~#: egrep -v '^(#|$)' /etc/dovecot/dovecot-sql.conf       
####
driver = mysql
connect = host=127.0.0.1 dbname=mailserver user=$USER \
password=$PASSWORD
default_pass_scheme = PLAIN-MD5
password_query = SELECT user_email AS user, \
                         user_password AS password \
                         FROM virtual_users WHERE user_email='%u';
####

Due to the fact that I'am new to dovecot and sieve I hope anybody can
help the solve this issue.

My target is to filter the mailinglists based on address extention or is
it better to filter on to header?

Is there a 'log' or 'print' command in the sieve filter or how can I
write a message to the log file?

Many thanks for your help

BR
Aleks
-------------- next part --------------
# 2.0.14: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-028stab092.1 x86_64 Ubuntu 10.04.3 LTS 
auth_mechanisms = plain login digest-md5 cram-md5
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_debug = yes
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date
passdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
protocols = imap
recipient_delimiter = -
service auth {
  unix_listener auth-userdb {
    group = vmail
    mode = 0755
    user = vmail
  }
  user = root
}
ssl_cert = </etc/dovecot/certs/dovecot.pem
ssl_cipher_list = ALL:!aNULL:!ADH:!eNULL:!LOW:!SSLv2:!EXP:!kEDH
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  driver = passwd
}
userdb {
  args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
  driver = static
}
protocol lda {
  mail_plugins = sieve
  recipient_delimiter = -
}


More information about the dovecot mailing list