Re: cyrus imap quota

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The text file format is a little tricky, as there is trailing whitespace which must be preserved.

The quota command is fast, so it is trivial to make a script to modify the quotas on the fly. I have a perl script which sucks quota information of of an LDAP directory and uses Cyrus::IMAP::Admin to update the files. It is fast enough to run every five minutes without any trouble.

I've attached my scripts if you want to take a look.

Cheers,
     -nic

On 04/07/2010 09:55 AM, Holm Kapschitzki wrote:
Simon Matter schrieb:

Holm Kapschitzki schrieb:

on my debian box running cyrus imap, most of the postboxes have a quota
of 100 MB configured. The info is stored in a textfile. On the first
line there is the currently quota and on the second line there is the
real hardquota, for example 100000 (100 MB)

Its possible to stop the cyrus mailserver und replace the second line
with another value without breaking something  for all the defined
postboxes?

Yes that's possible but you should use Cyrus quota command instead which
can be done while Cyrus is up and running. And note that quota information
can be stores in other database formats which will make the method above
unusable.



thx for answer. But i had to change over 5 thousend mailboxes. so its
impossible to change this boxes step by step. Thats the reason, i asked
for changing directly in the textfile. But you say thats impossible
cause it can be stores in other database formats. Do i have another
possibility?

Holm


--
Nic Bernstein                             nic@xxxxxxxxxxx
Onlight llc.                              www.onlight.com
219 N. Milwaukee St., Suite 2a		  v. 414.272.4477
Milwaukee, Wisconsin  53202

Attachment: cyrus_get_quota.pl
Description: Perl program

Attachment: cyrus_ldap_quota.pl
Description: Perl program

# cyrus.conf
#
# configuration file for perl scripts for Intersweep filter
#
# Copyright (c) Nic Bernstein, May 26, 2004, for
# Onlight, llc., 2266 N. Prospect Ave., Suite 610, Milwaukee, WI  53202
# All rights reserved

# The LDAP server to bind to
$ldap_host = 'localhost';

# The LDAP port number
$ldap_port = '389';

# The base DN for the search
$base_dn = 'ou=people,dc=example,dc=com';

# The DN to bind as to complete the search
$bind_dn = 'uid=proxyuser,ou=systems,dc=example,dc=com';

# The password to bind to LDAP with for the search
$bind_pw = 'secret';

# Filter to get usernames
$ldap_user_filter = '(objectClass=inetMailUser)';

# Attribute to return for username search
$ldap_user_attr = 'uid';

# Attribute to return for quota search
$ldap_quota_attr = 'mailQuota';

# Attribute to return for mail search
$ldap_mail_attr = "mailRoutingAddress";

# The IMAP server to login to
$imap_host = 'localhost';

# The IMAP user to login as
$imap_user = 'cyrus';

# The IMAP port number
$imap_port = '143';

# The IMAP delimiter character
$delimiter = ".";

# The password for the IMAP user
$imap_pw = 'secret';

# Prefix for IMAP user mailboxes
$imap_prefix = 'user';

# Change this to the proper setting for your site
# @time = (localtime)[0..5]; # for local time zone usage
@time = (gmtime)[0..5]; # for GMT usage

# Whitelist mailbox name and attribute
%white = (
	'mailbox'   => 'Whitelist',
	'attribute' => 'amavisWhitelistSender'
	 );

# Blacklist mailbox name and attribute
%black = (
	'mailbox'   => 'Blacklist',
	'attribute' => 'amavisBlacklistSender'
	 );

# Mail domain for re-sending
$mail_domain = 'example.com';

# User spam mailbox
$spambox = 'Junk';

# Shared mailbox for missed spam
$missed_uce = 'Missed-Junk';

# Shared mailbox for non-spam
$not_uce = 'Non-Junk';

----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux