Re: [Dovecot] Please HELP: how to delete all messages older than X days

2013-08-08 Thread Răzvan Sandu

Pe 7 Aug 2013 11:35, Timo Sirainen a scris:


Thank you, but doveadm expunge will ask for the mailbox name:

[root@mail1 ~]# doveadm expunge -u john@example.com ON
2013-08-07 doveadm(root): Fatal: expunge: To avoid accidents,
search query must contain MAILBOX in all search branches


Add: mailbox '*'


Thank you, it works!

May I use the same wildcard syntax ('*') when configuring the expire
plugin?  Something like:

mail_plugins = $mail_plugins expire

plugin {
  expire = *
}

or

plugin {
  expire = '*'
}


?


Best regards,
Răzvan
<>

Re: [Dovecot] Please HELP: how to delete all messages older than X days from the server?

2013-08-07 Thread Răzvan Sandu
On Tue, 06 Aug 2013 19:18:15 +0200, Pascal Volk a scris:

> There is also the -A option, see
> http://wiki2.dovecot.org/Tools/Doveadm/Expunge#section_options


Thank you, but doveadm expunge will ask for the mailbox name:

[root@mail1 ~]# doveadm expunge -u john@example.com ON 2013-08-07
doveadm(root): Fatal: expunge: To avoid accidents, search query must
contain MAILBOX in all search branches

What I need is to traverse *all* directories under
/var/spool/mail/vhosts/domainname/  (which are
/var/spool/mail/vhosts/domainname/username, with further variable
subdirectories, name never known in advance...) and to delete all
messages older than X days (incoming, sent, drafts, trash, etc.)

This must be done without manual confirmation ("are you sure...?") (if I
do it via a script run from cron).

>From the examples given in the wiki page, the expire plugin presents the
same problem: one must know in advance the *name of the mailbox* he has
to empty.

Also for the correct search criteria: should I use SAVEDBEFORE or
SENTBEFORE ?


Thanks again,
Răzvan








<>

[Dovecot] Please HELP: how to delete all messages older than X days from the server?

2013-08-06 Thread Răzvan Sandu

Hello,


Would you please help me solve the following case?

My (CentOS) server runs dovecot and allows both POP3 and IMAP service.
Users are virtual users (no home directories), with messages stored in 
Maildir directories under /var/spool/mail/vhosts/example.com/username


Some of them use mobile devices (without local storage space), so I must 
allow IMAP access, not just POP3. But the storage on the server must be 
for a strictly *limited* period of time.


As an admin, I'm trying to force each user to:

- download *locally* received messages when they arrive at the office
- don't let copies of messages on the server (incoming, sent, trash, 
drafts, etc.)


For various reasons, e-mail client configuration is not under my control 
(I can't rely on client configuration for implementing this).


Implementing filesystem quotas is not an option because a. presently, 
all virtual users share same UID/GID on the server and b. administrative 
reasons (the "full quota" situation may occur unexpectedly and this is 
not tolerable in corporate policy).



So I need EITHER:

1. a method of downloading locally *all* messages from the server 
(incoming, sent, trash, drafts, etc.) to the workstation, when the user 
consults his/her mailbox from a POP3 desktop client, thus completely 
*emptying* the user's mailbox on the server


OR

2. an automatic, elegant but forceful method of deleting all messages 
older than X days (incoming, sent, trash, drafts, etc.)



I've tried to use a line such as:

doveadm expunge -u john@example.com before 4w

run as root, from a script in crontab, but for "expunge" doveadm won't 
let me skip the "-u" parameter (to perform the expunge for *all* users).



Could you please help? Any sugestion is welcomed.


Thanks a lot,
Răzvan
<>

Re: [Dovecot] Forcibly emptying a POP3 mailbox

2010-02-04 Thread Răzvan Sandu

Steffen Kaiser wrote:
Well, I know that the client knows it has *successfully* downloaded 
messages, but how does the server know? Just to sent down some

packets through the wire does not mean success.


Thanks,

I see... so the server knows nothing about the success or insuccess of 
retrieving messages. Only client knows, so only client may act.


In that case, the only possibility is to have some automatic script that 
periodically "cleans" the "cur" subdirectories, as you suggested.


However, not being a programmer at all, I'm far from being able to write 
an industrial-grade solution for this.  ;-)


Best regards,
Răzvan







Re: [Dovecot] [RFE] A way to encode passwords in the /etc/imap.passwd file

2010-02-04 Thread Răzvan Sandu

@Pascal Volk

Thanks for the algorithm you've provided !

Unfortuantely, I'm not a programmer myself and I don't feel confident to 
code such an utility (even if I perfectly understand your pseudocode).  ;-)


What I'm looking for is not even a hand-made script, but a production 
solution included in the stock dovecot RPM package itself - i.e a new, 
better form of the dovecotpw utility.



Best regards,
Răzvan




Re: [Dovecot] Forcibly emptying a POP3 mailbox

2010-02-04 Thread Răzvan Sandu

Hello,

Thanks a lot, but the problem here are not the IMAP users accessing the 
server via squirrelmail. Few people use this.


What I mainly want to avoid are *POP3* users checking the „Leave a copy 
on the server” checkmark.


I need a way of automatically performing the DELE command at server 
level, just after a POP3 user *succesfully* downloaded his messages via 
POP3...


Thanks again,
Răzvan




[Dovecot] [RFE] A way to encode passwords in the /etc/imap.passwd file

2010-02-03 Thread Răzvan Sandu

Hello,


Is this the proper place to suggest an enhancement for the stock dovecot 
package ?



The enhancement would be the following:

For the time being, the dovecotpw utility offers a standardised way to 
interactively encode a user password in a certain scheme, say:


dovecotpw -s CRYPT
Enter new passord:
Re-enter new password:
etc.

Given a *valid* /etc/imap.passwd file (passwd-file authentication), 
dovecotpw should be able to process it non-interactively and output 
another text file with all {PLAIN} passwords converted in the specified 
, i.e.:


dovecotpwd -s CRYPT if=/etc/imap.passwd of=/etc/imap.passwd.converted

where /etc/imap.passwd.converted have the previously {PLAIN} passwords 
converted in scheme CRYPT.


Passwords that were previously encrypted in other schemes than {PLAIN} 
shoud remain untouched.


That will allow quick securing of old legacy /etc/imap.passwd files.


Thanks a lot,
Răzvan


[Dovecot] Forcibly emptying a POP3 mailbox

2010-02-03 Thread Răzvan Sandu

Hello,


I've recently saw a discussion on this list, about a standardised way of
emptying POP3 mailboxes on the server - but no solution came up.


Please provide a suggestion for the following situation:

- I am running a stock POP3 dovecot server, on Fedora 12 (dovecot
version 1.2.9)

- passwd-file authentication via /etc/imap.passwd

- users are virtual, sharing the same UID/GID;

- storage is in MailDir system;

- for remote users, server is POP3-only, since the administrative policy
says that every user should download his messages on the local
workstation, then delete them from server immediately after succesful
download.

- IMAP is allowed only locally, in order to be used together via stock
squirrelmail Web interface (for emergencies only)


However, there are users that check the infamous „Leave a copy on the 
server” checkbox (or equivalent) in their mail clients, eventually 
adding „Delete messages after X days”.


Since I have no direct administrative control on the clients, I
absolutely need a way to forbid the above behaviour at server level, in 
order to enforce the policy. The server's HDD is meant to store received 
messages from reception to the first access only.


Filesystem quotas are not an option in this scenario, since the UID/GID 
is the same for all virtual users.


What I need is way to make sure that "cur" and "tmp" subdirectories are 
perfectly empty after the user downloads his mail.


(I will also need a way to make sure that users using squirrelmail leave 
no populated "Sent" and "Trash" folders on server's HDD, but that's 
offtopic here).



Could you please suggest a way to solve this ?


Thanks a lot,

Răzvan