Re: [Dovecot] Dovecot Expire doesn't work

2009-06-29 Thread Charles Marcus
On 6/12/2009, Timo Sirainen (t...@iki.fi) wrote:
 In a mailbox1, I have this into Junk/cur directory:
 4 -rw---  1 dovecot  dovecot  3822 Feb  2 13:39 
 1233569469.M275631P48216.***.***.net,S=3822,W=3945:2,S
 4 -rw---  1 dovecot  dovecot  3004 Feb  2 15:43 
 1233585799.M730005P46882.***.***.net,W=3078,S=3004:2,S
 4 -rw---  1 dovecot  dovecot  3056 Feb  2 17:49 
 1233587786.M676156P51401.***.***.net,S=3056,W=3132:2,S
 4 -rw---  1 dovecot  dovecot  3732 Feb  2 17:49 
 1233592892.M701994P52459.***.***.net,S=3732,W=3823:2,S

 We are Feb 4, and these message are always here. No informations
 with mail_debug, or with --test parameter.These messages were arrived
 Feb 2, and they might have this date in dovecot.index.cache...

 Was expire plugin enabled then? If it wasn't, it didn't add them to its
 database so it doesn't know about them.

 ... has this changed?

 I'm not sure what above you think contradicts anything I said.. 

It doesn't, I'm just dense... ;) Thx...

And incidentally, I don't see how you can be so patient... my hat's off
to you... :)

-- 

Best regards,

Charles


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Stef Simoens

Hey Timo,

You should be able to do either of those with something like:

userdb passwd {
  args = mail=dbox:/var/mail/%u
}

v2.0 fixes this problem properly.
  

This works great ...

I didn't know that my (quite simple) setup wasn't supported in this way 
... maybe adding a note in the Wiki or so?


Thanks for your help.

Stef



Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Stef Simoens


Stef Simoens schreef:

Hey Timo,

You should be able to do either of those with something like:

userdb passwd {
  args = mail=dbox:/var/mail/%u
}

v2.0 fixes this problem properly.
  

This works great ...

Hmm, I cheered too fast.
The expire-plugin works ... but now my e-mails are delivered in ~ (which 
I don't want)


I tried both
mail_location = dbox:~/

userdb passwd {
args = mail=dbox:/var/mail/%u
}

and

mail_location = dbox:~/

userdb passwd {
args = home=/var/mail/%u mail=dbox:/var/mail/%u
}

... but both seem to prefer delivering my e-mail in ~


--
Stef Simoens stef.simo...@numericable.be
+32 486 577 963 http://users.numericable.be/stef



Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Timo Sirainen
On Mon, 2009-06-22 at 22:28 +0200, Stef Simoens wrote:
 Stef Simoens schreef:
  Hey Timo,
  You should be able to do either of those with something like:
 
  userdb passwd {
args = mail=dbox:/var/mail/%u
  }
 
  v2.0 fixes this problem properly.

  This works great ...
 Hmm, I cheered too fast.
 The expire-plugin works ... but now my e-mails are delivered in ~ (which 
 I don't want)

Set auth_debug=yes and mail_debug=yes, what does it log?

 I didn't know that my (quite simple) setup wasn't supported in this
 way 
 ... maybe adding a note in the Wiki or so?

I added one yesterday.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Stef Simoens

Timo Sirainen schreef:

Set auth_debug=yes and mail_debug=yes, what does it log?

  
Jun 22 22:48:09 robin dovecot: auth(default): master out: 
USER^I1^Istef^Ihome=/var/mail/stef^Imail=dbox:/var/mail/stef^Isystem_user=stef^Iuid=1000^Igid=1000
Jun 22 22:48:09 robin dovecot: IMAP(stef): Loading modules from 
directory: /usr/lib/dovecot/imap
Jun 22 22:48:09 robin dovecot: IMAP(stef): Module loaded: 
/usr/lib/dovecot/imap/lib20_expire_plugin.so
Jun 22 22:48:09 robin dovecot: IMAP(stef): Effective uid=1000, gid=1000, 
home=/var/mail/stef

Jun 22 22:48:09 robin dovecot: IMAP(stef): dbox: data=/var/mail/stef
Jun 22 22:48:09 robin dovecot: IMAP(stef): fs: root=/var/mail/stef, 
index=, control=, inbox=
Jun 22 22:48:09 robin dovecot: IMAP(stef): Disconnected: Logged out 
bytes=44/298

(...)
Jun 22 22:48:56 robin deliver(stef): Loading modules from directory: 
/usr/lib/dovecot/lda
Jun 22 22:48:56 robin deliver(stef): Module loaded: 
/usr/lib/dovecot/lda/lib20_expire_plugin.so
Jun 22 22:48:56 robin deliver(stef): Module loaded: 
/usr/lib/dovecot/lda/lib90_cmusieve_plugin.so

Jun 22 22:48:56 robin deliver(stef): dbox: data=/home/stef/
Jun 22 22:48:56 robin deliver(stef): fs: root=/home/stef, index=, 
control=, inbox=
Jun 22 22:48:56 robin deliver(stef): cmusieve: Using sieve path: 
/home/stef/.dovecot.sieve
Jun 22 22:48:56 robin deliver(stef): cmusieve: Executing script 
/home/stef/.dovecot.sievec
Jun 22 22:48:56 robin deliver(stef): 
msgid=05b564d81f8186e0fecc293288ba5eb9.squir...@www.bunderbos: saved 
mail to INBOX


I did restart the dovecot daemon after each configuration change, but I 
didn't restart postfix, did I have to?


Kr,

Stef

--
Stef Simoens stef.simo...@numericable.be
+32 486 577 963 http://users.numericable.be/stef



Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Timo Sirainen
On Mon, 2009-06-22 at 23:19 +0200, Stef Simoens wrote:
 Jun 22 22:48:56 robin deliver(stef): dbox: data=/home/stef/

Oh, so it's only deliver that's broken. I guess you aren't giving -d
parameter to deliver so it's not doing a userdb lookup. But there's no
need to add it, just keep what you had originally:

mail_location = dbox:/var/mail/%u

expire-tool (and imap, pop3, etc.) will just override it from the mail
returned by userdb lookup.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-22 Thread Stef Simoens

Timo Sirainen schreef:

On Mon, 2009-06-22 at 23:19 +0200, Stef Simoens wrote:
  

Jun 22 22:48:56 robin deliver(stef): dbox: data=/home/stef/



Oh, so it's only deliver that's broken. I guess you aren't giving -d
parameter to deliver so it's not doing a userdb lookup. But there's no
need to add it, just keep what you had originally:

mail_location = dbox:/var/mail/%u

expire-tool (and imap, pop3, etc.) will just override it from the mail
returned by userdb lookup.
  

Hello Timo,

This works.
Thanks for your investigation and time.

deliver uses mail_location = dbox:/var/mail/%u -- my e-mail gets 
delivered correctly


and all the other compontents use the path from userdb. I used args = 
home=/var/home/%u mail=dbox:/var/mail/%u -- and my e-mail gets expired 
correctly, too


Kind regards,

Stef

--
Stef Simoens stef.simo...@numericable.be
+32 486 577 963 http://users.numericable.be/stef



Re: [Dovecot] Dovecot Expire doesn't work

2009-06-21 Thread Timo Sirainen
On Thu, 2009-06-11 at 02:43 +0200, Stef Simoens wrote:
 mail_location: dbox:/var/mail/%u

This doesn't work with expire-tool, because the way

 A strace on `/usr/sbin/dovecot --exec-mail ext 
 /usr/libexec/dovecot/expire-tool --test`

works is that dovecot binary first reads dovecot.conf and expands all %u
to root. Then it executes expire-tool, which no longer sees %u at all
there. The only way to get this working is to have userdb return the
path. So:

a) mail_location = dbox:~/ and have userdb return home.

b) Have userdb return mail=dbox:/var/mail/username

   userdb:
 driver: passwd

You should be able to do either of those with something like:

userdb passwd {
  args = mail=dbox:/var/mail/%u
}

v2.0 fixes this problem properly.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-12 Thread Charles Marcus
On 6/11/2009 6:37 PM, Timo Sirainen wrote:
 it doesn't do anything (especially not deleting e-mails). 
 Obviously, in stef/Trash and stef/Spam, there are e-mails
 waiting to be deleted.

 It doesn't go by the email date, it goes by the date/time the
 email was moved into that folder.
 
 In other words, it won't effect emails that were *already* *in*
 the folder.
 
 Personally, I'd love to see the tool have an option to go by the
 email date/time instead of when it was moved into the folder...

 So in that case could you move them out and back again? I am
 considering using the plugin, but I'm still in the info gathering
 phase.

 You only need to move one mail into the mailbox so that the mailbox
 gets added to the database. Once that mail gets expunged, all the
 other old existing mails get expunged along with it.

!? This isn't what you said when this was discussed earlier earlier:

 On 2/4/2009 12:17 PM, Timo Sirainen wrote:
 On Wed, 2009-02-04 at 11:27 +0100, Nicolas Letellier wrote:
 Info: us...@domain.tld/Trash: stop, expire time in future: Wed
 Feb 4 21:00:50 2009
 
 Why this message? I have 3 mailboxes, and the message appears
 only with this mailbox.
 The 2 others mailbox have mails into Trash and Junk folders. And
 the mail are older than 2 days. An ls -lcs say it.

 Dovecot tracks the timestamp when the message was copied to Trash,
 not necessary its ctime. So you probably copied the message to
 Trash on Feb 3 21:00:50, which is why it'll get expunged at Feb 4
 21:00:50.

 In a mailbox1, I have this into Junk/cur directory:
  4 -rw---  1 dovecot  dovecot  3822 Feb  2 13:39 
 1233569469.M275631P48216.***.***.net,S=3822,W=3945:2,S
  4 -rw---  1 dovecot  dovecot  3004 Feb  2 15:43 
 1233585799.M730005P46882.***.***.net,W=3078,S=3004:2,S
  4 -rw---  1 dovecot  dovecot  3056 Feb  2 17:49 
 1233587786.M676156P51401.***.***.net,S=3056,W=3132:2,S
  4 -rw---  1 dovecot  dovecot  3732 Feb  2 17:49 
 1233592892.M701994P52459.***.***.net,S=3732,W=3823:2,S

 We are Feb 4, and these message are always here. No informations
 with mail_debug, or with --test parameter.These messages were arrived
 Feb 2, and they might have this date in dovecot.index.cache...

 Was expire plugin enabled then? If it wasn't, it didn't add them to its
 database so it doesn't know about them.

... has this changed? Or am I seriosuly misunderstanding what you said?
Or... you said 'the mailbox'... does this apply only to mbox files, or
to maildirs too?

Thanks for the clarification Timo...

-- 

Best regards,

Charles


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-12 Thread Timo Sirainen

On Jun 12, 2009, at 7:09 AM, Charles Marcus wrote:


You only need to move one mail into the mailbox so that the mailbox
gets added to the database. Once that mail gets expunged, all the
other old existing mails get expunged along with it.


!? This isn't what you said when this was discussed earlier earlier:


I thought I said it several times i several different ways and added a  
sentence about it to wiki too.. Expire plugin doesn't track each  
message individually. It only keeps a track of records:


mailbox name next timestamp when to look into this mailbox

When the timestamp is reached, it opens the mailbox and expunges all  
the messages that have old enough save-date.



On 2/4/2009 12:17 PM, Timo Sirainen wrote:

On Wed, 2009-02-04 at 11:27 +0100, Nicolas Letellier wrote:

Info: us...@domain.tld/Trash: stop, expire time in future: Wed
Feb 4 21:00:50 2009

Why this message? I have 3 mailboxes, and the message appears
only with this mailbox.
The 2 others mailbox have mails into Trash and Junk folders. And
the mail are older than 2 days. An ls -lcs say it.



Dovecot tracks the timestamp when the message was copied to Trash,
not necessary its ctime. So you probably copied the message to
Trash on Feb 3 21:00:50, which is why it'll get expunged at Feb 4
21:00:50.



In a mailbox1, I have this into Junk/cur directory:
4 -rw---  1 dovecot  dovecot  3822 Feb  2 13:39  
1233569469.M275631P48216.***.***.net,S=3822,W=3945:2,S
4 -rw---  1 dovecot  dovecot  3004 Feb  2 15:43  
1233585799.M730005P46882.***.***.net,W=3078,S=3004:2,S
4 -rw---  1 dovecot  dovecot  3056 Feb  2 17:49  
1233587786.M676156P51401.***.***.net,S=3056,W=3132:2,S
4 -rw---  1 dovecot  dovecot  3732 Feb  2 17:49  
1233592892.M701994P52459.***.***.net,S=3732,W=3823:2,S


We are Feb 4, and these message are always here. No informations
with mail_debug, or with --test parameter.These messages were  
arrived

Feb 2, and they might have this date in dovecot.index.cache...


Was expire plugin enabled then? If it wasn't, it didn't add them  
to its

database so it doesn't know about them.


... has this changed?


I'm not sure what above you think contradicts anything I said..


Or am I seriosuly misunderstanding what you said?


Possibly :)


Or... you said 'the mailbox'... does this apply only to mbox files, or
to maildirs too?



Expire plugin works the same way with both.


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-11 Thread Charles Marcus
On 6/10/2009, Stef Simoens (stef.simo...@scarlet.be) wrote:
 
 it doesn't do anything (especially not deleting e-mails).
 Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be 
 deleted.

It doesn't go by the email date, it goes by the date/time the email was
moved into that folder.

In other words, it won't effect emails that were *already* *in* the folder.

Personally, I'd love to see the tool have an option to go by the email
date/time instead of when it was moved into the folder...

-- 

Best regards,

Charles


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-11 Thread Scott Silva
on 6-11-2009 3:22 AM Charles Marcus spake the following:
 On 6/10/2009, Stef Simoens (stef.simo...@scarlet.be) wrote:
 it doesn't do anything (especially not deleting e-mails).
 Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be 
 deleted.
 
 It doesn't go by the email date, it goes by the date/time the email was
 moved into that folder.
 
 In other words, it won't effect emails that were *already* *in* the folder.
 
 Personally, I'd love to see the tool have an option to go by the email
 date/time instead of when it was moved into the folder...
 
So in that case could you move them out and back again? I am considering using
the plugin, but I'm still in the info gathering phase.



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-11 Thread Timo Sirainen
On Thu, 2009-06-11 at 15:27 -0700, Scott Silva wrote:
 on 6-11-2009 3:22 AM Charles Marcus spake the following:
  On 6/10/2009, Stef Simoens (stef.simo...@scarlet.be) wrote:
  it doesn't do anything (especially not deleting e-mails).
  Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be 
  deleted.
  
  It doesn't go by the email date, it goes by the date/time the email was
  moved into that folder.
  
  In other words, it won't effect emails that were *already* *in* the folder.
  
  Personally, I'd love to see the tool have an option to go by the email
  date/time instead of when it was moved into the folder...
  
 So in that case could you move them out and back again? I am considering using
 the plugin, but I'm still in the info gathering phase.

You only need to move one mail into the mailbox so that the mailbox gets
added to the database. Once that mail gets expunged, all the other old
existing mails get expunged along with it.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot Expire doesn't work

2009-06-11 Thread Stef Simoens

Hello,

I know how the expire plugin (should) work.
I am actually happy that the expire-plugin works as is is defined.

However, the plugin does not work.

- the folder /var/mail/root is created (empty) for no reason (root mails 
should be forwarded to me, stef)
- the mails in /var/mail/stef/Spam and/or /var/mail/stef/Trash are not 
expunged after the determined time


As written in my original mail, I did a `strace`. In the strace, I see 
that expire-tool 'reads' /var/mail/root and 'reports' that 
/var/mail/stef has no e-mails.


So, I see two options:
- I made a configuration error (but I don't see it, and I did some 
serious looking via google and on the wiki, but maybe it's so obvious I 
didn't pay attention)

- there is a bug in expire-tool

I wrote this e-mail because I suspect the latter [but please inform me 
if it's the first]


Thanks for your consideration

Stef

Scott Silva schreef:

on 6-11-2009 3:22 AM Charles Marcus spake the following:
  

On 6/10/2009, Stef Simoens (stef.simo...@scarlet.be) wrote:


it doesn't do anything (especially not deleting e-mails).
Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be deleted.
  

It doesn't go by the email date, it goes by the date/time the email was
moved into that folder.

In other words, it won't effect emails that were *already* *in* the folder.

Personally, I'd love to see the tool have an option to go by the email
date/time instead of when it was moved into the folder...



So in that case could you move them out and back again? I am considering using
the plugin, but I'm still in the info gathering phase.
  


[Dovecot] Dovecot Expire doesn't work

2009-06-10 Thread Stef Simoens

Hello,

I'm using dovecot and I want to use the expire plugin.
However, it doesn't work, i.e. mails do not get deleted.

I ran `/usr/sbin/dovecot --exec-mail ext 
/usr/libexec/dovecot/expire-tool --test`

and besides printing

Info: stef/Trash: no messages left
Info: stef/Spam: no messages left

it doesn't do anything (especially not deleting e-mails).
Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be 
deleted.


I'm using dbox as mail storage; and use dbox:/var/mail/%u as 
mail_location in dovecot.conf.

Furthermore, I'm running 1.1.16 on a gentoo PPC system.

This is the output from `dovecot -n`
# 1.1.16: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.29-gentoo-r2 ppc Gentoo Base System release 1.12.11.1 xfs
listen: *, [::]
ssl_cert_file: /etc/ssl/dovecot/server.pem
ssl_key_file: /etc/ssl/dovecot/server.key
login_dir: /var/run/dovecot/login
login_executable: /usr/libexec/dovecot/imap-login
verbose_proctitle: yes
mail_privileged_group: mail
mail_location: dbox:/var/mail/%u
mail_plugins: expire
auth default:
 verbose: yes
 debug: yes
 passdb:
   driver: pam
   args: *
 userdb:
   driver: passwd
 socket:
   type: listen
   master:
 path: /var/run/dovecot/auth-master
 mode: 384
plugin:
 quota: fs:Disk Quota
 expire: Trash 7 Spam 30
 expire_dict: proxy::expire
dict:
 expire: db:/var/lib/dovecot/expire.db

A strace on `/usr/sbin/dovecot --exec-mail ext 
/usr/libexec/dovecot/expire-tool --test`

shows the following output:

mkdir(/var/mail/root, 0770)   = -1 EEXIST (File exists)
stat64(/var/mail/root/Trash/dbox-Mails, 0xbfda2708) = -1 ENOENT (No 
such file or directory)
write(2, Info: stef/Trash: no messages lef..., 35Info: stef/Trash: no 
messages left

) = 35

which explains why nothing happens 
(stat64(/var/mail/root/Trash/dbox-Mails, which is empty, it should not 
even exist, but it passes by a mkdir), but why does it want to check 
/var/mail/root and not /var/mail/%u (i.e. why no 
stat64(/var/mail/stef/Trash/dbox-Mails))?


Thanks for your help and kind regards,

--
Stef Simoens



Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-31 Thread Timo Sirainen
On Thu, 2008-10-30 at 17:50 +0100, LÉVAI Dániel wrote:
  The / hardcoding only means the % wildcard matching, meaning if
  you've a mailbox foo/bar then % would match only foo part, but
  if you've a mailbox foo.bar then % would match the full
  foo.bar. In any case you'll need to use the separator you've
  configured in your namespaces.
 Where have I configured that? I'm just using maildir: in the 
 mail_location, 

If you haven't configured any namespaces, Dovecot will use the default
namespace with the default maildir separator (dot).

 and if I create a subdirectory with my MUA, in the 
 server on the filesystem it will separate it from the parent with a 
 dot. Is this configurable?

No. The filesystem separator is always a dot. But you can configure the
virtual separator with namespaces, i.e. what the clients will see and
what you'll use in configuration files to specify the mailbox names.

   Yep, now I can understand that, but what *is* weird, that the
   only debug information comes from this expire-tool when ran with
   the --test option. If I run it without it, it won't output anything
   anywhere. It would be nice to increase the logging for this (with
   or without the --test option), eg. when mail_debug=yes.
 
  What should it write? I guess -v parameter could do something.
  mail_debug=yes could affect the plugin's logging.
 I think, it should display that it found an expire = something entry 
 in dovecot.conf, and that it could find a matching directory under the 
 mail_location. While iterating over the messages that it has found, it 
 would be nice if it would write an info line with each message, 
 including the message's path/name,

Printing the message's path works only with maildir. Expire plugin works
also with mbox. It could print message's UID number though.

 the message's expire date in the 
 future, that it has been expunged, or that it would have been expunged, 
 but the --test option was set.

I'll see about adding these.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-30 Thread LÉVAI Dániel
On Monday 27 October 2008 14.26.50 LÉVAI Dániel wrote:
 Hi!

 I'm using dovecot-1.1.5 and trying to make the expire plugin work.
 What I've configured in dovecot.conf is the following:

 protocol imap,pop3,lda {
   mail_plugins = [...] expire
 }

 dict {
   expire = db:/var/dovecot/expire/expire.db
 }


 plugin {
expire = spamassassin/SPAM 2 spamassassin/HAM 2
expire_dict = proxy::expire
 }

 I have a sieve rule, to copy certain messages to my
 spamassassin/SPAM folder. Then I want to expire those messages
 after 2 days (I think I've configured that under the plugin{} section
 in dovecot.conf). So the actual message saving is done by the
 dovecot's deliver, but I have the plugin loaded under the protocol
 lda {} section too. So I thought now I just have to wait 2 days, and
 run the expire-tool, and then it will expire the messages.
 Now I have three messages dated back to 10.25, but running the
 expire-tool outputs nothing.
 # dovecot --exec-mail ext /usr/local/libexec/dovecot/expire-tool
 --test

 Nothing in the logfiles, and nothing on the console. I have the
 /var/dovecot/expire directory:
 # ls -la /var/dovecot/expire/
 total 1640
 drwx--  2 root  wheel   512 Oct 26 19:47:53 2008 ./
 drwxr-x---  3 root  wheel   512 Oct 27 07:57:42 2008 ../
 -rw---  1 root  wheel 24576 Oct 27 13:00:01 2008 __db.001
 -rw---  1 root  wheel 57344 Oct 27 13:00:01 2008 __db.002
 -rw---  1 root  wheel270336 Oct 27 13:00:01 2008 __db.003
 -rw---  1 root  wheel 98304 Oct 27 13:00:01 2008 __db.004
 -rw---  1 root  wheel 49152 Oct 27 13:00:01 2008 __db.005
 -rw---  1 root  wheel 32768 Oct 26 19:47:37 2008 expire.db
 -rw---  1 root  wheel  10485760 Oct 27 14:22:08 2008
 log.01

 It contains the familiar BDB files, so I think it works, although the
 expire.db's modify time is yesterday, but deliver saved some messages
 also today to the spamassassin/SPAM folder.

I've got bitten by this:
The wiki[1] reads:

[...]
 - % works by matching any number of characters, but it stops at the 
hierarchy separator. Currently the separator is hardcoded to /.
[...]
plugin {
  # Trash and its children 7d, Spam 30d
  expire = Trash 7 Trash/* 7 Spam 30
[...]

That is not exactly true. The separator which is working (as told me by 
e-frog, and as can be seen in the Maildir/ hierarchy) is the dot 
character (ie.: .).
My $USER/spamassassin/SPAM directory is not working as:
expire = spamassassin/SPAM 1
only as:
expire = spamassassin.SPAM 1

Also the dovecot-example.conf says:
The following dict block maps dictionary names to URIs when the server 
is used. These can then be referenced using URIs in 
format proxy:name.

That is not true either, it must be proxy::name (note the two 
colons) or else dovecot won't even start.

Anyway, for the record, I should mention that while it is easy to check 
whether dovecot is fooling around with a mysql database, it is not so 
straightforward with BDB.
One can check if the Berkeley database is being used with db4_dump (or 
on some systems db4.7_dump or db4.6_dump and so on...):

$ db4_dump -d a expire.db
[...]
page 1: btree leaf: LSN [0][1]: level 1
prev:0 next:0 entries:0 offset: 16384

^^^ the above contains no entries, while:
$ db4_dump -da expire.db
[...]
page 1: btree leaf: LSN [1][84670]: level 1
prev:0 next:0 entries:2 offset: 16344
[000] 16352 len:  29 data: shared/leva/spamassa...
[001] 16344 len:   4 data: ��0x08I
^^^ this contains entries. Don't ask me what is the second row, 
though :), and also it is a PITA that the data gets trimmed.


On Wednesday 29 October 2008 15.53.24 Timo Sirainen wrote:
 On Wed, 2008-10-29 at 15:25 +0100, LÉVAI Dániel wrote:
  When I ran `dovecot --exec-mail ext
  /usr/local/libexec/dovecot/expire-tool --test', it told me that:
  Info: leva/spamassassin.SPAM: stop, expire time in future:
  1225290174

 Sounds like it's working. It just wasn't time yet to expunge the
 oldest mail from there

Yep, now I can understand that, but what *is* weird, that the 
only debug information comes from this expire-tool when ran with 
the --test option. If I run it without it, it won't output anything 
anywhere. It would be nice to increase the logging for this (with or 
without the --test option), eg. when mail_debug=yes.


[1] - http://wiki.dovecot.org/Plugins/Expire

Daniel

-- 
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-30 Thread Timo Sirainen
On Thu, 2008-10-30 at 16:28 +0100, LÉVAI Dániel wrote:
 I've got bitten by this:
 The wiki[1] reads:
 
 [...]
  - % works by matching any number of characters, but it stops at the 
 hierarchy separator. Currently the separator is hardcoded to /.
 [...]
 plugin {
   # Trash and its children 7d, Spam 30d
   expire = Trash 7 Trash/* 7 Spam 30
 [...]
 
 That is not exactly true. The separator which is working (as told me by 
 e-frog, and as can be seen in the Maildir/ hierarchy) is the dot 
 character (ie.: .).

The / hardcoding only means the % wildcard matching, meaning if
you've a mailbox foo/bar then % would match only foo part, but if
you've a mailbox foo.bar then % would match the full foo.bar. In
any case you'll need to use the separator you've configured in your
namespaces. I guess wiki should explain this clearly. Or better yet, I
could fix the whole issue and remove it from wiki. :)

 Also the dovecot-example.conf says:
 The following dict block maps dictionary names to URIs when the server 
 is used. These can then be referenced using URIs in 
 format proxy:name.
 
 That is not true either, it must be proxy::name (note the two 
 colons) or else dovecot won't even start.

Fixed now.

 Yep, now I can understand that, but what *is* weird, that the 
 only debug information comes from this expire-tool when ran with 
 the --test option. If I run it without it, it won't output anything 
 anywhere. It would be nice to increase the logging for this (with or 
 without the --test option), eg. when mail_debug=yes.

What should it write? I guess -v parameter could do something.
mail_debug=yes could affect the plugin's logging.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-30 Thread LÉVAI Dániel
On Thursday 30 October 2008 16.42.16 Timo Sirainen wrote:
 On Thu, 2008-10-30 at 16:28 +0100, LÉVAI Dániel wrote:
  I've got bitten by this:
  The wiki[1] reads:
 
  [...]
   - % works by matching any number of characters, but it stops at
  the hierarchy separator. Currently the separator is hardcoded to
  /. [...]
  plugin {
# Trash and its children 7d, Spam 30d
expire = Trash 7 Trash/* 7 Spam 30
  [...]
 
  That is not exactly true. The separator which is working (as told
  me by e-frog, and as can be seen in the Maildir/ hierarchy) is the
  dot character (ie.: .).

 The / hardcoding only means the % wildcard matching, meaning if
 you've a mailbox foo/bar then % would match only foo part, but
 if you've a mailbox foo.bar then % would match the full
 foo.bar. In any case you'll need to use the separator you've
 configured in your namespaces.
Where have I configured that? I'm just using maildir: in the 
mail_location, and if I create a subdirectory with my MUA, in the 
server on the filesystem it will separate it from the parent with a 
dot. Is this configurable?

  Yep, now I can understand that, but what *is* weird, that the
  only debug information comes from this expire-tool when ran with
  the --test option. If I run it without it, it won't output anything
  anywhere. It would be nice to increase the logging for this (with
  or without the --test option), eg. when mail_debug=yes.

 What should it write? I guess -v parameter could do something.
 mail_debug=yes could affect the plugin's logging.
I think, it should display that it found an expire = something entry 
in dovecot.conf, and that it could find a matching directory under the 
mail_location. While iterating over the messages that it has found, it 
would be nice if it would write an info line with each message, 
including the message's path/name, the message's expire date in the 
future, that it has been expunged, or that it would have been expunged, 
but the --test option was set.
Like:
$ .../expire-tool --test
expire = spamassassin.SPAM 1 spamassassin.HAM 1
match: /var/virtualmaildir/user1/Maildir/.spamassassin.SPAM/
cur/1225290969.M266240P9922.host,W=3210,S=3155:2,S will expire on Oct 
31, 13:01
cur/1225291087.M157951P9922.host,W=3267,S=3193:2,S will expire on Oct 
30, 19:25
cur/1225292609.M646577P6712.host,S=2802,W=2874:2,S expunged (not really)
cur/1225316456.M35928P11573.host,S=3760,W=3852:2,S expunged (not really)
cur/1225333013.M644866P4387.host,S=4208,W=4311:2,S expunged (not really)
cur/1225350074.M658507P24283.host,W=2508,S=2462:2,S expunged (not 
really)
cur/1225361450.M896405P30952.host,S=58036,W=58865:2,S expunged (not 
really)
match: /var/virtualmaildir/user1/Maildir/.spamassassin.HAM/
cur/1225381029.M654813P11449.host,W=5325,S=5268:2,S expunged (not 
really)
match: /var/virtualmaildir/user116/Maildir/.spamassassin.HAM/
cur/1225290969.M35928P11573.host,W=5325,S=5268:2,S will expire on Oct 
31, 01:54

Of course without the --test option it wouldn't have to write the (not 
really) part.
Anyway, something like the above :)

Daniel

-- 
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-29 Thread LÉVAI Dániel

e-frog wrote:


Anybody has this working? 


Yes.

Great! Then all hope is not lost :)




plugin {
expire = spamassassin/SPAM 1
expire_dict = proxy::expire
}


For me it works by using '.' as hierarchy separator. So in your case 
expire = spamassassin.SPAM 1 should work. This could be different when 
using namespaces, which I don't.
I don't use namespaces either, and I've changed my dovecot.conf to use 
the '.' as separator.




That is, if I want to expire the emails under the spamassassin/SPAM 
directory, after 1 day. Is this correct? I'm asking this because with 
this setup, the expire-tool does nothing... nothing in the logs either.


Try and set mail_debug=yes. It should log more.

Done.

When I ran `dovecot --exec-mail ext 
/usr/local/libexec/dovecot/expire-tool --test', it told me that:

Info: leva/spamassassin.SPAM: stop, expire time in future: 1225290174

Since I've run it without the --test option, it outputs nothing anymore, 
and nothing in the logs.


What else did you configure? Or is there some other thing I should do?

Thanks!

Daniel

--
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-29 Thread Timo Sirainen
On Wed, 2008-10-29 at 15:25 +0100, LÉVAI Dániel wrote:
  That is, if I want to expire the emails under the spamassassin/SPAM 
  directory, after 1 day. Is this correct? I'm asking this because with 
  this setup, the expire-tool does nothing... nothing in the logs either.
  
  Try and set mail_debug=yes. It should log more.
 Done.
 
 When I ran `dovecot --exec-mail ext 
 /usr/local/libexec/dovecot/expire-tool --test', it told me that:
 Info: leva/spamassassin.SPAM: stop, expire time in future: 1225290174

Sounds like it's working. It just wasn't time yet to expunge the oldest
mail from there:

% unix2date.sh -u 1225290174
Wed Oct 29 14:22:54 UTC 2008

Running it again now would show that it's going to expunge it? I suppose
I should change the code to show the timestamp in user-understandable
form. :)



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-29 Thread LÉVAI Dániel
On Wednesday 29 October 2008 15.53.24 you wrote:
 On Wed, 2008-10-29 at 15:25 +0100, LÉVAI Dániel wrote:
   That is, if I want to expire the emails under the
   spamassassin/SPAM directory, after 1 day. Is this correct? I'm
   asking this because with this setup, the expire-tool does
   nothing... nothing in the logs either.
  
   Try and set mail_debug=yes. It should log more.
 
  Done.
 
  When I ran `dovecot --exec-mail ext
  /usr/local/libexec/dovecot/expire-tool --test', it told me that:
  Info: leva/spamassassin.SPAM: stop, expire time in future:
  1225290174

 Sounds like it's working. It just wasn't time yet to expunge the
 oldest mail from there:

 % unix2date.sh -u 1225290174
 Wed Oct 29 14:22:54 UTC 2008

 Running it again now would show that it's going to expunge it?
Unfortunately not:
# ls -lrt $USER/Maildir/.spamassassin.SPAM/cur/
1840 Oct 25 03:17:55 2008 1225137329.[...],W=1890,S=1840:2,S
1978 Oct 25 04:32:37 2008 1225137329.[...],W=2028,S=1978:2,S
3773 Oct 25 13:12:23 2008 1225137329.[...],W=3841,S=3773:2,S
2749 Oct 26 02:10:28 2008 1225137329.[...],W=2835,S=2749:2,S
3783 Oct 26 13:15:36 2008 1225137329.[...],W=3852,S=3783:2,S
13172 Oct 26 18:30:16 2008 1225137329.[...],W=13377,S=13172:2,S
2292 Oct 27 08:00:07 2008 1225137329.[...],W=2340,S=2292:2,S
1985 Oct 27 08:00:10 2008 1225137329.[...],W=2031,S=1985:2,S
26644 Oct 27 16:02:35 2008 1225137329.[...],W=27234,S=26644:2,S
3209 Oct 27 16:23:57 2008 1225137329.[...],W=3282,S=3209:2,S
3155 Oct 27 19:13:38 2008 1225290969.[...],W=3210,S=3155:2,S
3193 Oct 27 22:11:38 2008 1225291087.[...],W=3267,S=3193:2,S
 Oct 28 01:06:51 2008 1225203774.[...],W=4502,S=:2,S
4793 Oct 28 09:42:31 2008 1225203785.[...],W=4849,S=4793:2,S
2925 Oct 28 14:04:10 2008 1225203793.[...],W=2977,S=2925:2,S
3727 Oct 28 17:51:33 2008 1225218230.[...],W=3819,S=3727:2,S
255537 Oct 29 00:27:32 2008 1225236452.[...],S=255537,W=259071:2,S
4021 Oct 29 04:02:59 2008 1225249379.[...],S=4021,W=4119:2,S
2802 Oct 29 16:03:29 2008 1225292609.[...],S=2802,W=2874:2,S

You see the oldest message is dated back four days from now, and no 
matter if I run the expire-tool without the --test option, it won't 
expunge them. Although all of the messages was saved by dovecot's 
deliver, the expire-tool doesn't seem to recognize but one of the 
messages. That is the last one, created on Oct 29, 16:03.

# /usr/local/sbin/dovecot --exec-mail \
ext /usr/local/libexec/dovecot/expire-tool --test
Info: leva/spamassassin.SPAM: stop, expire time in future: 1225379009
# date -r 1225379009
Thu Oct 30 16:03:29 CET 2008

Daniel

-- 
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-29 Thread e-frog



# /usr/local/sbin/dovecot --exec-mail \
ext /usr/local/libexec/dovecot/expire-tool --test
Info: leva/spamassassin.SPAM: stop, expire time in future: 1225379009
# date -r 1225379009
Thu Oct 30 16:03:29 CET 2008


Try it again tomorrow past 16:03:29 and it will expunge all your messages
older than Oct 29 16:03:29. The expire database was most likely not updated
till you fixed the configuration today. This means it doesn't know about
the old messages.







Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-29 Thread Timo Sirainen
On Wed, 2008-10-29 at 20:14 +0100, LÉVAI Dániel wrote:
  Running it again now would show that it's going to expunge it?
 Unfortunately not:
 # ls -lrt $USER/Maildir/.spamassassin.SPAM/cur/
 1840 Oct 25 03:17:55 2008 1225137329.[...],W=1890,S=1840:2,S
 1978 Oct 25 04:32:37 2008 1225137329.[...],W=2028,S=1978:2,S
..
 You see the oldest message is dated back four days from now, and no 
 matter if I run the expire-tool without the --test option, it won't 
 expunge them.

Ah, but expunge plugin works on save dates, not by mtime. The save
date is cached to dovecot.index.cache file and it's always older or
equal to file's ctime. So use ls -lc instead.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-28 Thread LÉVAI Dániel

Hi!

Anybody has this working? I mean, at least somebody has to use this 
expire plugin with BDB, no? :D
I think, maybe the problem is withing the plugin { expire = } setting; 
to be honest, I'm a little confused with this.

I have a maildir layout like this:
[..some dirs..]/$USER/Maildir/

Under the above directory, there are the users' subdirectories. So the 
subdirectory in question (spamassassin/SPAM), is 
[..somedirs..]/$USER/Maildir/.spamassassin.SPAM/


# ls -1a [..somedirs..]/$USER/Maildir/.spamassassin.SPAM/
./
../
cur/
dovecot-uidlist
dovecot.index
dovecot.index.cache
dovecot.index.log
maildirfolder
new/
tmp/

According to the WIKI page, I must write this to my dovecot.conf:
plugin {
expire = spamassassin/SPAM 1
expire_dict = proxy::expire
}

That is, if I want to expire the emails under the spamassassin/SPAM 
directory, after 1 day. Is this correct? I'm asking this because with 
this setup, the expire-tool does nothing... nothing in the logs either.
I've experimented with expire = spamassassin.SPAM and 
expire=spamassassin/SPAM/* too, but no luck. Could someone send me 
some working dovecot.conf, and setup, so I can diff it against mine? Or 
maybe just a little tossing in the right direction would be enough.


Thanks in advance!

Daniel


LÉVAI Dániel wrote:

Hi!

I'm using dovecot-1.1.5 and trying to make the expire plugin work.
What I've configured in dovecot.conf is the following:

protocol imap,pop3,lda {
mail_plugins = [...] expire
}

dict {
expire = db:/var/dovecot/expire/expire.db
}


plugin {
  expire = spamassassin/SPAM 2 spamassassin/HAM 2
  expire_dict = proxy::expire
}

I have a sieve rule, to copy certain messages to my spamassassin/SPAM 
folder. Then I want to expire those messages after 2 days (I think I've 
configured that under the plugin{} section in dovecot.conf).
So the actual message saving is done by the dovecot's deliver, but I 
have the plugin loaded under the protocol lda {} section too.
So I thought now I just have to wait 2 days, and run the expire-tool, 
and then it will expire the messages.
Now I have three messages dated back to 10.25, but running the 
expire-tool outputs nothing.

# dovecot --exec-mail ext /usr/local/libexec/dovecot/expire-tool --test

Nothing in the logfiles, and nothing on the console. I have the 
/var/dovecot/expire directory:

# ls -la /var/dovecot/expire/
total 1640
drwx--  2 root  wheel   512 Oct 26 19:47:53 2008 ./
drwxr-x---  3 root  wheel   512 Oct 27 07:57:42 2008 ../
-rw---  1 root  wheel 24576 Oct 27 13:00:01 2008 __db.001
-rw---  1 root  wheel 57344 Oct 27 13:00:01 2008 __db.002
-rw---  1 root  wheel270336 Oct 27 13:00:01 2008 __db.003
-rw---  1 root  wheel 98304 Oct 27 13:00:01 2008 __db.004
-rw---  1 root  wheel 49152 Oct 27 13:00:01 2008 __db.005
-rw---  1 root  wheel 32768 Oct 26 19:47:37 2008 expire.db
-rw---  1 root  wheel  10485760 Oct 27 14:22:08 2008 log.01

It contains the familiar BDB files, so I think it works, although the 
expire.db's modify time is yesterday, but deliver saved some messages 
also today to the spamassassin/SPAM folder.


What could be the problem? Am I missing something?

Thanks!

Daniel




--
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: [Dovecot] dovecot expire doesn't work (?)

2008-10-28 Thread e-frog


Anybody has this working? 


Yes.


plugin {
expire = spamassassin/SPAM 1
expire_dict = proxy::expire
}


For me it works by using '.' as hierarchy separator. So in your case expire = 
spamassassin.SPAM 1 should work. This could be different when using namespaces, 
which I don't.

That is, if I want to expire the emails under the spamassassin/SPAM 
directory, after 1 day. Is this correct? I'm asking this because with 
this setup, the expire-tool does nothing... nothing in the logs either.


Try and set mail_debug=yes. It should log more.




[Dovecot] dovecot expire doesn't work (?)

2008-10-27 Thread LÉVAI Dániel

Hi!

I'm using dovecot-1.1.5 and trying to make the expire plugin work.
What I've configured in dovecot.conf is the following:

protocol imap,pop3,lda {
mail_plugins = [...] expire
}

dict {
expire = db:/var/dovecot/expire/expire.db
}


plugin {
  expire = spamassassin/SPAM 2 spamassassin/HAM 2
  expire_dict = proxy::expire
}

I have a sieve rule, to copy certain messages to my spamassassin/SPAM 
folder. Then I want to expire those messages after 2 days (I think I've 
configured that under the plugin{} section in dovecot.conf).
So the actual message saving is done by the dovecot's deliver, but I 
have the plugin loaded under the protocol lda {} section too.
So I thought now I just have to wait 2 days, and run the expire-tool, 
and then it will expire the messages.
Now I have three messages dated back to 10.25, but running the 
expire-tool outputs nothing.

# dovecot --exec-mail ext /usr/local/libexec/dovecot/expire-tool --test

Nothing in the logfiles, and nothing on the console. I have the 
/var/dovecot/expire directory:

# ls -la /var/dovecot/expire/
total 1640
drwx--  2 root  wheel   512 Oct 26 19:47:53 2008 ./
drwxr-x---  3 root  wheel   512 Oct 27 07:57:42 2008 ../
-rw---  1 root  wheel 24576 Oct 27 13:00:01 2008 __db.001
-rw---  1 root  wheel 57344 Oct 27 13:00:01 2008 __db.002
-rw---  1 root  wheel270336 Oct 27 13:00:01 2008 __db.003
-rw---  1 root  wheel 98304 Oct 27 13:00:01 2008 __db.004
-rw---  1 root  wheel 49152 Oct 27 13:00:01 2008 __db.005
-rw---  1 root  wheel 32768 Oct 26 19:47:37 2008 expire.db
-rw---  1 root  wheel  10485760 Oct 27 14:22:08 2008 log.01

It contains the familiar BDB files, so I think it works, although the 
expire.db's modify time is yesterday, but deliver saved some messages 
also today to the spamassassin/SPAM folder.


What could be the problem? Am I missing something?

Thanks!

Daniel

--
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1