Aleksandar Lazic
2011-Sep-12 17:14 UTC
[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination
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, altSep 11 21:48:27 lvps46-163-74-15
dovecot: lda(al at none.at): Debug: none:
root=, index=, control=, inbox=, altSep 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 = -
}
Jerry
2011-Sep-12 18:22 UTC
[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination
On Mon, 12 Sep 2011 19:14:48 +0200 Aleksandar Lazic articulated: <snip>> 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}I use plus addressing and this is the entry in the master.cf file from Postfix: dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${recipient} The "argv" could be different on your system; however the rest should be the same as mine I would assume. If you do make a change, you will have to restart Postfix for it to take effect. -- Jerry ? Dovecot.user at seibercom.net Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __________________________________________________________________
Stephan Bosch
2011-Sep-15 09:29 UTC
[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination
Op 12-9-2011 19:14, Aleksandar Lazic schreef:> Is there a 'log' or 'print' command in the sieve filter or how can I > write a message to the log file?With the latest Pigeonhole (0.2.4), you can use the vnd.dovecot.debug extension (which is not available by default and therefore needs to be added to sieve_extensions), e.g. ==require "vnd.dovecot.debug"; require "envelope"; require "variables"; if envelope :matches "to" "*" { debug_log "envelope to `${1}'"; } == A message should be logged to the user's personal log file (typically ~/.dovecot.sieve.log), e.g: ==sieve: info: started log at Sep 15 11:27:26. main_script: line 6: info: DEBUG: envelope to = `user at example.com'. info: msgid=3453453534r42 at example.com: stored mail into mailbox 'INBOX'. == Regards, Stephan.
Aleksandar Lazic
2011-Sep-17 10:52 UTC
[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination
Dear Stephan, On Sam 17.09.2011 01:30, Stephan Bosch wrote:>Op 16-9-2011 23:35, Stephan Bosch schreef: >> >>My guess is that you need to add the recipient_delimiter setting to >>the plugin section also: >> >>plugin { >>recipient_delimiter = - >>} >> >>Matbe this should be unified somehow. >> > >This should be fixed in hg now.Your guess was right, thanks. Thanks also that the next release will use the global recipient_delimiter. Aleks