Hi all. I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
Thanks in advance.
-Pietro.
On 18/02/2008, Pietro webmad75@gmail.com wrote:
Hi all. I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
Thanks in advance.
-Pietro.
Of course. Run a cron job to search, for example, for files older than a certain date.
Delete all files in /cur which are older than 30 days: /usr/bin/find /home/vmail/*/.Junk/cur -mtime +30 -type f -daystart -exec rm '{}' \;
Hope that helps.
Kind regards, Ronald.
-- Ronald MacDonald http://www.rmacd.com/ 0777 235 1655
Thanks a lot Ronald. Is there any issue I must consider about dovecot indexes? -Pietro.
2008/2/18, Ronald MacDonald ronald@rmacd.com:
On 18/02/2008, Pietro webmad75@gmail.com wrote:
Hi all. I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
Thanks in advance.
-Pietro.
Of course. Run a cron job to search, for example, for files older than a certain date.
Delete all files in /cur which are older than 30 days: /usr/bin/find /home/vmail/*/.Junk/cur -mtime +30 -type f -daystart -exec rm '{}' \;
Hope that helps.
Kind regards, Ronald.
-- Ronald MacDonald http://www.rmacd.com/ 0777 235 1655
Pietro wrote:
Thanks a lot Ronald. Is there any issue I must consider about dovecot indexes?
Dovecot will log an warning but nothing much else, so it is pretty safe.
Tomi
-Pietro.
2008/2/18, Ronald MacDonald ronald@rmacd.com:
On 18/02/2008, Pietro webmad75@gmail.com wrote:
Hi all. I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
Thanks in advance.
-Pietro.
Of course. Run a cron job to search, for example, for files older than a certain date.
Delete all files in /cur which are older than 30 days: /usr/bin/find /home/vmail/*/.Junk/cur -mtime +30 -type f -daystart -exec rm '{}' \;
Hope that helps.
Kind regards, Ronald.
-- Ronald MacDonald http://www.rmacd.com/ 0777 235 1655
Marc Perkel, on 2/18/2008 11:28 AM, said the following:
I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
It would be a nice feature in Dovecot to have it be able to remove messages older than say 3 days from Trash automatically.
V 1.1 already can (see Expire plug-in), but I'm not sure if this only happens at use3r log in or not...
http://wiki.dovecot.org/Plugins/Expire
Also, there is a plugin that will auto delete Trash messages in case of over quota:
http://wiki.dovecot.org/Plugins/Trash
--
Best regards,
Charles
On Mon, 18 Feb 2008, Charles Marcus wrote:
Marc Perkel, on 2/18/2008 11:28 AM, said the following:
I'm looking for a way to empty user's trash folder. Can message deletion or folder purging be scheduled?
It would be a nice feature in Dovecot to have it be able to remove messages older than say 3 days from Trash automatically.
V 1.1 already can (see Expire plug-in), but I'm not sure if this only happens at use3r log in or not...
Said I: (in the thread "Deleting messages from MailDir")
Does the expunge plugin work without the user logging in, though?
Timo responded:
Yes. That's exactly what it does. It keeps user/mailbox <-> oldest_msg mapping in a Berkeley DB. In a nightly (or whatever) run it then uses the database to open only those mailboxes that have messages to be expunged.
Best, Ben
Benjamin R. Haskell, on 2/18/2008 12:52 PM, said the following:
Said I: (in the thread "Deleting messages from MailDir")
Does the expunge plugin work without the user logging in, though?
Timo responded:
Yes. That's exactly what it does. It keeps user/mailbox <-> oldest_msg mapping in a Berkeley DB. In a nightly (or whatever) run it then uses the database to open only those mailboxes that have messages to be expunged.
Cool, missed that one, thanks Benjamin... :)
--
Best regards,
Charles
On Feb 18, 2008, at 12:52 PM, Benjamin R. Haskell wrote:
On Mon, 18 Feb 2008, Charles Marcus wrote:
Marc Perkel, on 2/18/2008 11:28 AM, said the following:
I'm looking for a way to empty user's trash folder. Can message
deletion or folder purging be scheduled?It would be a nice feature in Dovecot to have it be able to
remove messages older than say 3 days from Trash automatically.V 1.1 already can (see Expire plug-in), but I'm not sure if this
only happens at use3r log in or not...Said I: (in the thread "Deleting messages from MailDir")
Does the expunge plugin work without the user logging in, though?
Timo responded:
Yes. That's exactly what it does. It keeps user/mailbox <->
oldest_msg mapping in a Berkeley DB. In a nightly (or whatever)
run it then uses the database to open only those mailboxes that
have messages to be expunged.
Excuse me but somebody, maybe me?, is confusing the expire plugin
with the lazy_expunge plugin. From reading the fine documentation,
it appears that...
- There is no expunge plugin, only a lazy_expunge plugin
- The lazy_expunge plugin runs "by itself" but requires a nightly
cron job if you want to delete old mail. - There is an expire plugin which I believe the original poster was
asking about - The expire plugin requires a nightly cron job to call /usr/libexec/ dovecot/expire-tool to do its thing
B. Bodger New York, NY
On 2/18/2008, Bruce Bodger (bbodger@bodcon.com) wrote:
Excuse me but somebody, maybe me?, is confusing the expire plugin with the lazy_expunge plugin. From reading the fine documentation, it appears that...
- There is no expunge plugin, only a lazy_expunge plugin
Well..... that is correct, that earlier reference to an 'expunge' plugin was apparently just a typo...
- The lazy_expunge plugin runs "by itself" but requires a nightly cron job if you want to delete old mail.
- There is an expire plugin which I believe the original poster was asking about
- The expire plugin requires a nightly cron job to call /usr/libexec/dovecot/expire-tool to do its thing
The cron job is only for v 1.0.x systems. The expire plugin only works on 1.1+
As far as I can tell, the expire plugin does not require a cron job to do its thing...
--
Best regards,
Charles
On Feb 18, 2008, at 4:01 PM, Charles Marcus wrote:
The cron job is only for v 1.0.x systems. The expire plugin only
works on 1.1+
Agreed
As far as I can tell, the expire plugin does not require a cron job
to do its thing...
Guess we'll need some clarification from Timo, Charles, because the
1.1.beta16 dovecot-example.conf states...
# Expire plugin. Mails are expunged from mailboxes after being there the
# configurable time. The first expiration date for each mailbox is
stored in
# a dictionary so it can be quickly determined which mailboxes contain
# expired mails. The actual expunging is done in a nightly cronjob,
which
# you must set up:
# dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
#expire = Trash 7 Spam 30
#expire_dict = db:/var/lib/dovecot/expire.db
Also, the above instructions are also a tad confusing. It seems like
the plugin runs at a system level so how to define mailboxes at the
user level? (what should that "expire" line be?)
P.S. One more thing... He sure doesn't help things by using the word
"expunge" in a paragraph that defines the expire plugin. I'd much
prefer the definition read something like this:
# Expire plugin. Mails are MARKED FOR DELETION from mailboxes after
being there the
# configurable time. The first expiration date for each mailbox is
stored in
# a dictionary so it can be quickly determined which mailboxes contain
# expired mails. The actual DELETION is done in a nightly cronjob, which
# you must set up:
:-)
B. Bodger New York, NY
On 2/18/2008, Bruce Bodger (bbodger@bodcon.com) wrote:
Guess we'll need some clarification from Timo, Charles, because the 1.1.beta16 dovecot-example.conf states...
# The actual expunging is done in a nightly cronjob, # which you must set up: # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool #expire = Trash 7 Spam 30 #expire_dict = db:/var/lib/dovecot/expire.db
Ok, sound slike I was wrong... it would be nice of it didn't require a cronjob, though...
P.S. One more thing... He sure doesn't help things by using the word "expunge" in a paragraph that defines the expire plugin. I'd much prefer the definition read something like this:
Well... expunge is indeed the correct term for deleting messages from a maiildir using IMAP, and dovecot is primarily an IMAP server... ;)
But I see your point too.
--
Best regards,
Charles
On Feb 19, 2008, at 12:21 AM, Bruce Bodger wrote:
As far as I can tell, the expire plugin does not require a cron job
to do its thing...Guess we'll need some clarification from Timo, Charles, because the
1.1.beta16 dovecot-example.conf states...# Expire plugin. Mails are expunged from mailboxes after being there
the # configurable time. The first expiration date for each mailbox is
stored in # a dictionary so it can be quickly determined which mailboxes contain # expired mails. The actual expunging is done in a nightly cronjob,
which # you must set up: # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool #expire = Trash 7 Spam 30 #expire_dict = db:/var/lib/dovecot/expire.dbAlso, the above instructions are also a tad confusing. It seems
like the plugin runs at a system level so how to define mailboxes at
the user level? (what should that "expire" line be?)
In dovecot.conf the mailboxes are defined globally. So in the example
Trash and Spam mailboxes match all users' Trash and Spam mailboxes. If
you want to have per-user expire lines, you can do it by overriding
the expire setting from userdb, in the same was as per-user quota is
configured.
The expire plugin itsels just keeps track of messages in those
mailboxes. It doesn't ever actually expunge anything itself.
P.S. One more thing... He sure doesn't help things by using the
word "expunge" in a paragraph that defines the expire plugin. I'd
much prefer the definition read something like this:# Expire plugin. Mails are MARKED FOR DELETION from mailboxes after
being there the
But that's wrong. "Marked for deletion" means adding a \Deleted flag
for a message. expire-tool really does expunge the messages permanently.
I've been thinking more about reducing commenting in dovecot-
example.conf and just point to wiki page which can explain things in
more words. Maybe I'll do that before v1.1.rc1 :)
On Feb 19, 2008, at 6:06 AM, Timo Sirainen wrote:
Still, the expire plugin is not the easiest plugin to configure.
Getting the error "Unknown dict module: db" which, on Sept. 24,
2007, you explained as...
The problem is that imap binary isn't linked with libdb, so this
doesn't work. You'll have to somehow kludge this yourself, or an easier way is to use dict proxy. It's configured the same way as SQL for dict quota: http://wiki.dovecot.org/Quota/Dict
Shouldn't there be an easier way, Timo?
B. Bodger New York, NY
On Tue, 2008-02-19 at 10:37 -0500, Bruce Bodger wrote:
On Feb 19, 2008, at 6:06 AM, Timo Sirainen wrote:
Still, the expire plugin is not the easiest plugin to configure.
Getting the error "Unknown dict module: db" which, on Sept. 24,
2007, you explained as...The problem is that imap binary isn't linked with libdb, so this
doesn't work. You'll have to somehow kludge this yourself, or an easier way is to use dict proxy. It's configured the same way as SQL for dict quota: http://wiki.dovecot.org/Quota/DictShouldn't there be an easier way, Timo?
Maybe, but it'll have to wait. Dict proxy should work fine and it's not too difficult to configure.
participants (8)
-
Benjamin R. Haskell
-
Bruce Bodger
-
Charles Marcus
-
Marc Perkel
-
Pietro
-
Ronald MacDonald
-
Timo Sirainen
-
Tomi Hakala