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@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@none.at uid=5000 gid=5000 home=/var/vmail/none.at/al Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al@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@none.at): Debug: maildir: root exists (/var/vmail/none.at/al/Maildir) Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al@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@none.at): Debug: none: root=, index=, control=, inbox=, alt= Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al@none.at): Debug: Destination address: al-pdnsuser@none.at (source: -a parameter) Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(al@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@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@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@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@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@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@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