[Dovecot] Sieve isn't working

2010-06-19 Thread Steven Weiß

Hi,

I tried to get Sieve plugin running but I don't get it to work and 
actually have no idea what's wrong.


My dovecot version is 1.2.12 and dovecot -n prints this:

# 1.2.12: /usr/local/etc/dovecot.conf
# OS: Linux 2.6.18-028stab064.7 i686 openSUSE 11.1 (i586) reiserfs
log_path: /var/log/dovecot.log
info_log_path: /var/log/dovecot.log
disable_plaintext_auth: no
login_dir: /usr/local/var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
first_valid_uid: 110
last_valid_uid: 110
mail_location: maildir:/var/qmail/mailnames/%d/%n/Maildir
fsync_disable: yes
lda:
  postmaster_address: postmas...@code-factory.de
  mail_plugins: sieve
  mail_plugin_dir: /usr/local/lib/dovecot/lda
  fsync_disable: no
auth default:
  passdb:
driver: passwd-file
args: /usr/local/etc/passwd.dovecot
  userdb:
driver: passwd
  userdb:
driver: static
args: uid=popuser gid=popuser
plugin:
  sieve: /var/mail/mydomain/.dovecot.sieve
  sieve_global_path: /var/lib/dovecot/sieve/default.sieve
  sieve_dir: /var/mail/mydomain/sieve
  sieve_global_dir: /var/lib/dovecot/sieve/global/


For testing purposes I created a very simple 
/var/mail/mydomain/.dovecot.sieve with the following content:


require ["fileinto", "regex"];

if address :is "from" "t...@test.de" {
fileinto "INBOX.Webi";
stop;
}

Then I sent a mail from t...@test.de (the real address is ommitted here) 
to my mail account, but the mail is not moved to the subfolder Webi. In 
the log files there's no single hint what's going on. And in 
/var/mail/mydomain there's no .dovecot.sieve.log file.
This directory is owned by popuser and that user has rights for reading 
and writing to this directory (and read rights for .dovecot.sieve), 
therefore it should not be a rights problem.


Does anybody has suggestions what could be the cause of this?

Sincerely, Steven


Re: [Dovecot] Sieve isn't working

2010-06-19 Thread Steven Weiß

Hi Pascal,

thanks for the quick reply.

I enabled mail_debug and restarted dovecot, but still no entry in the 
log file. I assume that deliver isn't properly set up. I'm using qmail 
and configured /var/qmail/control/defaultdelivery as follows:


| /var/qmail/bin/preline -f /usr/local/libexec/dovecot/deliver -d 
mym...@mydomain.de


Running ps aux | grep "deliver" gives me this:
qmail-lspawn | /var/qmail/bin/preline -f 
/usr/local/libexec/dovecot/deliver -d mym...@mydomain.de


I checked both paths of preline and deliver and they're correct. And I 
use the fixed mail address passed as -d as seen above. The user is set 
up in the static userdb file:

mym...@mydomain.de:{PLAIN}mypasswd

As I understood the mechanics of qmail / deliver interaction it looks 
correct to me. But something must be wrong :-(


Greetings, Steven



Am 19.06.2010 19:00, schrieb Pascal Volk:

On 06/19/2010 05:24 PM Steven Weiß wrote:

# 1.2.12: /usr/local/etc/dovecot.conf
# OS: Linux 2.6.18-028stab064.7 i686 openSUSE 11.1 (i586) reiserfs
log_path: /var/log/dovecot.log
info_log_path: /var/log/dovecot.log
disable_plaintext_auth: no
login_dir: /usr/local/var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
first_valid_uid: 110
last_valid_uid: 110
mail_location: maildir:/var/qmail/mailnames/%d/%n/Maildir
fsync_disable: yes
lda:
postmaster_address: postmas...@code-factory.de
mail_plugins: sieve
mail_plugin_dir: /usr/local/lib/dovecot/lda
fsync_disable: no
auth default:
passdb:
  driver: passwd-file
  args: /usr/local/etc/passwd.dovecot
userdb:
  driver: passwd
userdb:
  driver: static
  args: uid=popuser gid=popuser
plugin:
sieve: /var/mail/mydomain/.dovecot.sieve
sieve_global_path: /var/lib/dovecot/sieve/default.sieve
sieve_dir: /var/mail/mydomain/sieve
sieve_global_dir: /var/lib/dovecot/sieve/global/


Enable mail_debug, at least in the protocol lda {} section.
That will log information like module loading and what the sieve plugin
wants and finds/gets.



For testing purposes I created a very simple
/var/mail/mydomain/.dovecot.sieve with the following content:

require ["fileinto", "regex"];

if address :is "from" "t...@test.de" {
fileinto "INBOX.Webi";
stop;
}

Then I sent a mail from t...@test.de (the real address is ommitted here)
to my mail account, but the mail is not moved to the subfolder Webi. In
the log files there's no single hint what's going on. And in
/var/mail/mydomain there's no .dovecot.sieve.log file.
This directory is owned by popuser and that user has rights for reading
and writing to this directory (and read rights for .dovecot.sieve),
therefore it should not be a rights problem.

Does anybody has suggestions what could be the cause of this?


Also check your mail log, after enabling mail_debug.


Regards,
Pascal


Re: [Dovecot] Sieve isn't working

2010-06-19 Thread Steven Weiß

Am 19.06.2010 19:30, schrieb Pascal Volk:

On 06/19/2010 07:18 PM Steven Weiß wrote:

Hi Pascal,

thanks for the quick reply.

I enabled mail_debug and restarted dovecot, but still no entry in the
log file. I assume that deliver isn't properly set up. I'm using qmail
and configured /var/qmail/control/defaultdelivery as follows:

| /var/qmail/bin/preline -f /usr/local/libexec/dovecot/deliver -d
mym...@mydomain.de

Running ps aux | grep "deliver" gives me this:
qmail-lspawn | /var/qmail/bin/preline -f
/usr/local/libexec/dovecot/deliver -d mym...@mydomain.de

I checked both paths of preline and deliver and they're correct. And I
use the fixed mail address passed as -d as seen above. The user is set
up in the static userdb file:
mym...@mydomain.de:{PLAIN}mypasswd

As I understood the mechanics of qmail / deliver interaction it looks
correct to me. But something must be wrong :-(



Please stop top-posting.


My apologies for that, I'm new on a mailing list.



Qmail‽

Fist configure a 'master socket', so deliver will be able to
perform user lookups. see http://wiki.dovecot.org/LDA#Virtual_users

Then save a message as /tmp/testmail
Finally execute:

/usr/local/libexec/dovecot/deliver -d  -f  


With the manual call it worked. In the log files I can see that the 
sieve script was loaded and executed and the test mail was stuffed into 
the right folder.


The only problem now is that deliver isn't called from qmail. Do you 
have any idea why that's the case? I did everything as explained in the 
Wiki.


Greetings, Steven


Re: [Dovecot] Sieve isn't working

2010-06-19 Thread Steven Weiß

Am 19.06.2010 19:30, schrieb Pascal Volk:

On 06/19/2010 07:18 PM Steven Weiß wrote:

Hi Pascal,

thanks for the quick reply.

I enabled mail_debug and restarted dovecot, but still no entry in the
log file. I assume that deliver isn't properly set up. I'm using qmail
and configured /var/qmail/control/defaultdelivery as follows:

| /var/qmail/bin/preline -f /usr/local/libexec/dovecot/deliver -d
mym...@mydomain.de

Running ps aux | grep "deliver" gives me this:
qmail-lspawn | /var/qmail/bin/preline -f
/usr/local/libexec/dovecot/deliver -d mym...@mydomain.de

I checked both paths of preline and deliver and they're correct. And I
use the fixed mail address passed as -d as seen above. The user is set
up in the static userdb file:
mym...@mydomain.de:{PLAIN}mypasswd

As I understood the mechanics of qmail / deliver interaction it looks
correct to me. But something must be wrong :-(



Please stop top-posting.

Qmail‽

Fist configure a 'master socket', so deliver will be able to
perform user lookups. see http://wiki.dovecot.org/LDA#Virtual_users

Then save a message as /tmp/testmail
Finally execute:

/usr/local/libexec/dovecot/deliver -d  -f  


Wholy crap, I got it :-)
In the maildir there was a .qmail file which overwrote the qmail 
delivery specified in the defaultdelivery file...I was migrating from 
qmail/courier to qmail/dovecot and didn't know of that file.


Thanks for your help!

Greetings, Steven


[Dovecot] Configure Dovecot to move read mails to another folder?

2010-08-06 Thread Steven Weiß

Hallo,

is it possible (with dovecot sieve?) to deliver incoming mails to the 
default INBOX and then, when I have read the mail with Thunderbird, 
automatically move it to another folder?


I know I could create filters in my mail client. But that has the 
disadvantage that I would need to create these filters everywhere: on my 
office PC, at home, webmail, ...


Also moving a mail from one folder to another marks the original mail as 
deleted, at least in Thunderbird. Maybe other clients finally delete the 
mail.


Therefore that would be really cool.

Another related problem for me is: how can I automatically move outgoing 
mails to another folder? I created sieve-rules but it doesn't work - the 
mails remain in the folder "sent-mail".


For example:

if address :domain :is "to" "somedomain.de" {
fileinto "sent-mail.Somedomain";
stop;
}

Greetings,
Steven