This list is closed, nobody may subscribe to it.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(18) |
Feb
(43) |
Mar
(11) |
Apr
(50) |
May
(10) |
Jun
|
Jul
(39) |
Aug
(30) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(14) |
Feb
(43) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(12) |
Nov
(45) |
Dec
(3) |
| 2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(65) |
May
(2) |
Jun
(19) |
Jul
(6) |
Aug
(19) |
Sep
(23) |
Oct
(11) |
Nov
(21) |
Dec
(16) |
| 2013 |
Jan
(21) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(4) |
Feb
(34) |
Mar
(10) |
Apr
|
May
|
Jun
(10) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(1) |
2
(3) |
3
|
4
(2) |
5
|
|
6
(1) |
7
(2) |
8
(2) |
9
(1) |
10
(3) |
11
(5) |
12
(4) |
|
13
(3) |
14
(1) |
15
|
16
|
17
|
18
(4) |
19
|
|
20
|
21
(1) |
22
(5) |
23
|
24
(3) |
25
(1) |
26
|
|
27
(1) |
28
|
|
|
|
|
|
|
From: <nev...@us...> - 2011-02-27 14:35:19
|
details: http://hg.localdomain.org/vmm/rev/d4a341248500 changeset: 420:d4a341248500 user: Pascal Volk date: Sun Feb 27 14:35:04 2011 +0000 description: VMM/cli/subcommands: Added function update_cmd_map(). So the items will be added to the cmd_map when gettext's _() has been installed -> translatable subcommand descriptions. diffstat: VirtualMailManager/cli/main.py | 4 +++- VirtualMailManager/cli/subcommands.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diffs (63 lines): diff -r 241b192bfcc8 -r d4a341248500 VirtualMailManager/cli/main.py --- a/VirtualMailManager/cli/main.py Thu Feb 24 22:15:10 2011 +0000 +++ b/VirtualMailManager/cli/main.py Sun Feb 27 14:35:04 2011 +0000 @@ -16,7 +16,8 @@ from VirtualMailManager.cli.handler import CliHandler from VirtualMailManager.constants import DATABASE_ERROR, EX_MISSING_ARGS, \ EX_SUCCESS, EX_UNKNOWN_COMMAND, EX_USER_INTERRUPT, INVALID_ARGUMENT -from VirtualMailManager.cli.subcommands import RunContext, cmd_map, usage +from VirtualMailManager.cli.subcommands import RunContext, cmd_map, \ + update_cmd_map, usage _ = lambda msg: msg @@ -35,6 +36,7 @@ def run(argv): + update_cmd_map() if len(argv) < 2: usage(EX_MISSING_ARGS, _(u"You must specify a subcommand at least.")) diff -r 241b192bfcc8 -r d4a341248500 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Thu Feb 24 22:15:10 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sun Feb 27 14:35:04 2011 +0000 @@ -36,6 +36,7 @@ _ = lambda msg: msg txt_wrpr = TextWrapper(width=get_winsize()[1] - 1) +cmd_map = {} class Command(object): @@ -626,15 +627,18 @@ __copyright__, prog, _(u'is free software and comes with ABSOLUTELY NO WARRANTY.'))) -cmd = Command -cmd_map = { # {{{ + +def update_cmd_map(): + """Update the cmd_map, after gettext's _ was installed.""" + cmd = Command + cmd_map.update({ # Account commands 'getuser': cmd('getuser', 'gu', get_user, _(u'uid'), _(u'get the address of the user with the given UID')), 'useradd': cmd('useradd', 'ua', user_add, _(u'address [password]'), _(u'create a new e-mail user with the given address')), 'userdelete': cmd('userdelete', 'ud', user_delete, - _(u'address') + ' [force]', + _(u'address') + ' [force]', _(u'delete the specified user')), 'userdisable': cmd('userdisable', 'u0', user_disable, _(u'address [service ...]'), @@ -714,7 +718,7 @@ _(u'show a help overview or help for the given subcommand')), 'version': cmd('version', 'v', version, '', _(u'show version and copyright information')), -} # }}} + }) def _get_order(ctx): |
|
From: <nev...@us...> - 2011-02-25 01:14:25
|
details: http://hg.localdomain.org/vmm/rev/241b192bfcc8 changeset: 419:241b192bfcc8 user: Pascal Volk date: Thu Feb 24 22:15:10 2011 +0000 description: po: Regenerated vmm.pot diffstat: po/vmm.pot | 686 +++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 463 insertions(+), 223 deletions(-) diffs (truncated from 1269 to 300 lines): diff -r 542a4d23a9f0 -r 241b192bfcc8 po/vmm.pot --- a/po/vmm.pot Thu Feb 24 22:01:06 2011 +0000 +++ b/po/vmm.pot Thu Feb 24 22:15:10 2011 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: vmm 0.6.0\n" "Report-Msgid-Bugs-To: nev...@us...\n" -"POT-Creation-Date: 2010-08-05 23:17+0000\n" +"POT-Creation-Date: 2011-02-24 23:05+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -20,94 +20,98 @@ #. TP: Hm, what “quotation marks” should be used? #. If you are unsure have a look at: #. http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage -#: VirtualMailManager/account.py:58 VirtualMailManager/alias.py:34 -#: VirtualMailManager/domain.py:109 VirtualMailManager/relocated.py:38 +#: VirtualMailManager/account.py:59 VirtualMailManager/alias.py:34 +#: VirtualMailManager/domain.py:114 VirtualMailManager/relocated.py:38 #, python-format -msgid "The domain '%s' doesn't exist." +msgid "The domain '%s' does not exist." msgstr "" -#: VirtualMailManager/account.py:99 +#: VirtualMailManager/account.py:103 #, python-format -msgid "The mailbox format '%(mbfmt)s' requires Dovecot >= v%(version)s" +msgid "The mailbox format '%(mbfmt)s' requires Dovecot >= v%(version)s." msgstr "" -#: VirtualMailManager/account.py:105 +#: VirtualMailManager/account.py:110 VirtualMailManager/account.py:347 #, python-format -msgid "Invalid transport '%(transport)s' for mailbox format '%(mbfmt)s'" +msgid "Invalid transport '%(transport)s' for mailbox format '%(mbfmt)s'." msgstr "" -#: VirtualMailManager/account.py:128 +#: VirtualMailManager/account.py:133 #, python-format msgid "Unknown service: '%s'" msgstr "" -#: VirtualMailManager/account.py:160 VirtualMailManager/cli/handler.py:89 -#: VirtualMailManager/handler.py:543 VirtualMailManager/handler.py:593 -#: VirtualMailManager/handler.py:619 VirtualMailManager/handler.py:630 -#: VirtualMailManager/handler.py:641 VirtualMailManager/handler.py:653 -#: VirtualMailManager/handler.py:665 +#: VirtualMailManager/account.py:183 VirtualMailManager/cli/handler.py:93 +#: VirtualMailManager/handler.py:605 VirtualMailManager/handler.py:655 +#: VirtualMailManager/handler.py:681 VirtualMailManager/handler.py:692 +#: VirtualMailManager/handler.py:703 VirtualMailManager/handler.py:715 +#: VirtualMailManager/handler.py:727 VirtualMailManager/handler.py:739 #, python-format -msgid "The account '%s' doesn't exist." +msgid "The account '%s' does not exist." msgstr "" -#: VirtualMailManager/account.py:211 VirtualMailManager/handler.py:615 +#: VirtualMailManager/account.py:234 VirtualMailManager/account.py:264 +#: VirtualMailManager/cli/handler.py:77 VirtualMailManager/handler.py:573 +#, python-format +msgid "The account '%s' already exists." +msgstr "" + +#: VirtualMailManager/account.py:237 VirtualMailManager/handler.py:677 #, python-format msgid "Could not accept password: '%s'" msgstr "" -#: VirtualMailManager/account.py:251 VirtualMailManager/cli/handler.py:76 -#: VirtualMailManager/handler.py:515 +#: VirtualMailManager/account.py:267 #, python-format -msgid "The account '%s' already exists." +msgid "No password set for account: '%s'" msgstr "" -#: VirtualMailManager/account.py:254 -#, python-format -msgid "No password set for '%s'." -msgstr "" - -#: VirtualMailManager/account.py:289 +#: VirtualMailManager/account.py:302 #, python-format msgid "Unknown field: '%s'" msgstr "" +#: VirtualMailManager/account.py:324 VirtualMailManager/domain.py:271 +msgid "PostgreSQL-based dictionary quota requires Dovecot >= v1.1.2." +msgstr "" + #. TP: A service (pop3/imap) is enabled/usable for a user -#: VirtualMailManager/account.py:331 +#: VirtualMailManager/account.py:381 msgid "enabled" msgstr "" #. TP: A service (pop3/imap) isn't enabled/usable for a user -#: VirtualMailManager/account.py:334 +#: VirtualMailManager/account.py:384 msgid "disabled" msgstr "" -#: VirtualMailManager/account.py:343 +#: VirtualMailManager/account.py:395 #, python-format msgid "Could not fetch information for account: '%s'" msgstr "" -#: VirtualMailManager/account.py:387 +#: VirtualMailManager/account.py:439 #, python-format msgid "There are %(count)d aliases with the destination address '%(address)s'." msgstr "" -#: VirtualMailManager/account.py:416 +#: VirtualMailManager/account.py:468 msgid "UID must be an int/long." msgstr "" -#: VirtualMailManager/account.py:418 +#: VirtualMailManager/account.py:470 msgid "UID must be greater than 0." msgstr "" -#: VirtualMailManager/account.py:427 +#: VirtualMailManager/account.py:479 #, python-format -msgid "There is no account with the UID '%d'." +msgid "There is no account with the UID: '%d'" msgstr "" #: VirtualMailManager/alias.py:59 #, python-format msgid "" -"Can't add %(count_new)i new destination(s) to alias '%(address)s'.\n" +"Cannot add %(count_new)i new destination(s) to alias '%(address)s'.\n" "Currently this alias expands into %(count)i/%(limit)i recipients.\n" "%(count_new)i additional destination(s) will render this alias unusable.\n" "Hint: Increase Postfix' virtual_alias_expansion_limit" @@ -116,21 +120,21 @@ #: VirtualMailManager/alias.py:66 #, python-format msgid "" -"Can't add %(count_new)i new destination(s) to alias '%(address)s'.\n" +"Cannot add %(count_new)i new destination(s) to alias '%(address)s'.\n" "This alias already exceeds its expansion limit (%(count)i/%(limit)i).\n" "So its unusable, all messages addressed to this alias will be bounced.\n" "Hint: Delete some destination addresses." msgstr "" -#: VirtualMailManager/alias.py:140 VirtualMailManager/alias.py:152 -#: VirtualMailManager/alias.py:159 VirtualMailManager/handler.py:572 +#: VirtualMailManager/alias.py:141 VirtualMailManager/alias.py:153 +#: VirtualMailManager/alias.py:160 VirtualMailManager/handler.py:634 #, python-format -msgid "The alias '%s' doesn't exist." +msgid "The alias '%s' does not exist." msgstr "" -#: VirtualMailManager/alias.py:143 +#: VirtualMailManager/alias.py:144 #, python-format -msgid "The address '%(addr)s' isn't a destination of the alias '%(alias)s'." +msgid "The address '%(addr)s' is not a destination of the alias '%(alias)s'." msgstr "" #: VirtualMailManager/aliasdomain.py:50 @@ -149,13 +153,13 @@ #: VirtualMailManager/aliasdomain.py:75 VirtualMailManager/aliasdomain.py:109 #, python-format -msgid "The target domain '%s' doesn't exist." +msgid "The target domain '%s' does not exist." msgstr "" #: VirtualMailManager/aliasdomain.py:88 VirtualMailManager/aliasdomain.py:112 #: VirtualMailManager/aliasdomain.py:133 #, python-format -msgid "The alias domain '%s' doesn't exist." +msgid "The alias domain '%s' does not exist." msgstr "" #: VirtualMailManager/aliasdomain.py:98 @@ -184,11 +188,11 @@ msgstr "" #: VirtualMailManager/cli/__init__.py:91 -msgid "Sorry, passwords do not match" +msgid "Sorry, passwords do not match." msgstr "" #: VirtualMailManager/cli/__init__.py:95 -msgid "Sorry, empty passwords are not permitted" +msgid "Sorry, empty passwords are not permitted." msgstr "" #: VirtualMailManager/cli/config.py:32 @@ -196,7 +200,7 @@ msgid "Enter new value for option %(option)s [%(current_value)s]: " msgstr "" -#: VirtualMailManager/cli/config.py:36 VirtualMailManager/config.py:377 +#: VirtualMailManager/cli/config.py:36 #, python-format msgid "Using configuration file: %s\n" msgstr "" @@ -211,185 +215,244 @@ msgid "Warning: %s" msgstr "" -#: VirtualMailManager/cli/handler.py:68 +#: VirtualMailManager/cli/handler.py:66 #, python-format msgid "Invalid section: '%s'" msgstr "" -#: VirtualMailManager/cli/main.py:29 VirtualMailManager/cli/main.py:60 -#: VirtualMailManager/cli/subcommands.py:477 -#: VirtualMailManager/cli/subcommands.py:497 +#: VirtualMailManager/cli/main.py:31 VirtualMailManager/cli/main.py:63 +#: VirtualMailManager/cli/main.py:66 VirtualMailManager/cli/subcommands.py:592 +#: VirtualMailManager/cli/subcommands.py:612 #, python-format msgid "Error: %s" msgstr "" -#: VirtualMailManager/cli/main.py:36 -msgid "You must specify a subcommand at least" +#: VirtualMailManager/cli/main.py:39 +msgid "You must specify a subcommand at least." msgstr "" -#: VirtualMailManager/cli/main.py:48 +#: VirtualMailManager/cli/main.py:51 #, python-format msgid "Unknown subcommand: '%s'" msgstr "" #. TP: We have to cry, because root has killed/interrupted vmm #. with Ctrl+C or Ctrl+D. -#: VirtualMailManager/cli/main.py:57 +#: VirtualMailManager/cli/main.py:60 msgid "Ouch!" msgstr "" -#: VirtualMailManager/cli/main.py:63 +#: VirtualMailManager/cli/main.py:69 +#, python-format +msgid "Error: Unknown section: '%s'" +msgstr "" + +#: VirtualMailManager/cli/main.py:72 +#, python-format +msgid "Error: No option '%(option)s' in section: '%(section)s'" +msgstr "" + +#: VirtualMailManager/cli/main.py:75 msgid "Warnings:" msgstr "" -#: VirtualMailManager/cli/subcommands.py:74 +#: VirtualMailManager/cli/subcommands.py:76 #, python-format msgid "Plan A failed ... trying Plan B: %(subcommand)s %(object)s" msgstr "" -#: VirtualMailManager/cli/subcommands.py:88 +#: VirtualMailManager/cli/subcommands.py:90 msgid "Missing alias address and destination." msgstr "" -#: VirtualMailManager/cli/subcommands.py:91 -#: VirtualMailManager/cli/subcommands.py:319 +#: VirtualMailManager/cli/subcommands.py:93 +#: VirtualMailManager/cli/subcommands.py:400 msgid "Missing destination address." msgstr "" -#: VirtualMailManager/cli/subcommands.py:98 -#: VirtualMailManager/cli/subcommands.py:108 +#: VirtualMailManager/cli/subcommands.py:100 +#: VirtualMailManager/cli/subcommands.py:110 msgid "Missing alias address." msgstr "" -#: VirtualMailManager/cli/subcommands.py:130 -#: VirtualMailManager/cli/subcommands.py:164 +#: VirtualMailManager/cli/subcommands.py:132 +#: VirtualMailManager/cli/subcommands.py:166 msgid "Missing alias domain name and destination domain name." msgstr "" -#: VirtualMailManager/cli/subcommands.py:133 -#: VirtualMailManager/cli/subcommands.py:167 +#: VirtualMailManager/cli/subcommands.py:135 |
|
From: <nev...@us...> - 2011-02-24 22:01:18
|
details: http://hg.localdomain.org/vmm/rev/542a4d23a9f0 changeset: 418:542a4d23a9f0 user: Pascal Volk date: Thu Feb 24 22:01:06 2011 +0000 description: VMM/cli/subcommands: The keyword 'force' is no longer translatable. diffstat: VirtualMailManager/cli/subcommands.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diffs (32 lines): diff -r 8209da83e256 -r 542a4d23a9f0 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Thu Feb 24 20:47:35 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Thu Feb 24 22:01:06 2011 +0000 @@ -633,7 +633,8 @@ _(u'get the address of the user with the given UID')), 'useradd': cmd('useradd', 'ua', user_add, _(u'address [password]'), _(u'create a new e-mail user with the given address')), - 'userdelete': cmd('userdelete', 'ud', user_delete, _(u'address [force]'), + 'userdelete': cmd('userdelete', 'ud', user_delete, + _(u'address') + ' [force]', _(u'delete the specified user')), 'userdisable': cmd('userdisable', 'u0', user_disable, _(u'address [service ...]'), @@ -681,15 +682,15 @@ 'domainadd': cmd('domainadd', 'da', domain_add, _(u'fqdn [transport]'), _(u'create a new domain')), 'domaindelete': cmd('domaindelete', 'dd', domain_delete, - _(u'fqdn [force]'), + _(u'fqdn') + ' [force]', _(u'delete the given domain and all its alias domains')), 'domaininfo': cmd('domaininfo', 'di', domain_info, _(u'fqdn [details]'), _(u'display information about the given domain')), 'domainquota': cmd('domainquota', 'dq', domain_quota, - _(u'fqdn storage [messages] [force]'), + _(u'fqdn storage [messages]') + ' [force]', _(u'update the quota limit of the specified domain')), 'domaintransport': cmd('domaintransport', 'dt', domain_transport, - _(u'fqdn transport [force]'), + _(u'fqdn transport') + ' [force]', _(u'update the transport of the specified domain')), 'listdomains': cmd('listdomains', 'ld', list_domains, _(u'[pattern]'), _(u'list all domains / search domains by pattern')), |
|
From: <nev...@us...> - 2011-02-24 20:47:55
|
details: http://hg.localdomain.org/vmm/rev/8209da83e256 changeset: 417:8209da83e256 user: Pascal Volk date: Thu Feb 24 20:47:35 2011 +0000 description: VMM: Updated some messages. (doesn't, isn't) -> (does not, is not) Added missing dots at the end of some sentences. diffstat: VirtualMailManager/account.py | 17 +++++++++-------- VirtualMailManager/alias.py | 14 +++++++------- VirtualMailManager/aliasdomain.py | 10 +++++----- VirtualMailManager/cli/__init__.py | 4 ++-- VirtualMailManager/cli/handler.py | 2 +- VirtualMailManager/cli/main.py | 5 +++-- VirtualMailManager/cli/subcommands.py | 2 +- VirtualMailManager/domain.py | 4 ++-- VirtualMailManager/emailaddress.py | 10 +++++----- VirtualMailManager/ext/postconf.py | 2 +- VirtualMailManager/handler.py | 32 ++++++++++++++++---------------- VirtualMailManager/password.py | 6 +++--- VirtualMailManager/relocated.py | 6 +++--- 13 files changed, 58 insertions(+), 56 deletions(-) diffs (truncated from 494 to 300 lines): diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/account.py --- a/VirtualMailManager/account.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/account.py Thu Feb 24 20:47:35 2011 +0000 @@ -56,7 +56,7 @@ # TP: Hm, what “quotation marks” should be used? # If you are unsure have a look at: # http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage - raise AErr(_(u"The domain '%s' doesn't exist.") % + raise AErr(_(u"The domain '%s' does not exist.") % self._addr.domainname, NO_SUCH_DOMAIN) self._uid = 0 self._mail = None @@ -101,13 +101,14 @@ """ if maillocation.dovecot_version > cfg_dget('misc.dovecot_version'): raise AErr(_(u"The mailbox format '%(mbfmt)s' requires Dovecot " - u">= v%(version)s") % {'mbfmt': maillocation.mbformat, + u">= v%(version)s.") % { + 'mbfmt': maillocation.mbformat, 'version': version_str(maillocation.dovecot_version)}, INVALID_MAIL_LOCATION) if not maillocation.postfix and \ self._transport.transport.lower() in ('virtual:', 'virtual'): raise AErr(_(u"Invalid transport '%(transport)s' for mailbox " - u"format '%(mbfmt)s'") % + u"format '%(mbfmt)s'.") % {'transport': self._transport, 'mbfmt': maillocation.mbformat}, INVALID_MAIL_LOCATION) self._mail = maillocation @@ -179,7 +180,7 @@ """Raise an AccountError if the Account is new - not yet saved in the database.""" if self._new: - raise AErr(_(u"The account '%s' doesn't exist.") % self._addr, + raise AErr(_(u"The account '%s' does not exist.") % self._addr, NO_SUCH_ACCOUNT) @property @@ -263,7 +264,7 @@ raise AErr(_(u"The account '%s' already exists.") % self._addr, ACCOUNT_EXISTS) if not self._passwd: - raise AErr(_(u"No password set for '%s'.") % self._addr, + raise AErr(_(u"No password set for account: '%s'") % self._addr, ACCOUNT_MISSING_PASSWORD) if cfg_dget('misc.dovecot_version') >= 0x10200b02: sieve_col = 'sieve' @@ -321,7 +322,7 @@ """ if cfg_dget('misc.dovecot_version') < 0x10102f00: raise VMMError(_(u'PostgreSQL-based dictionary quota requires ' - u'Dovecot >= v1.1.2'), VMM_ERROR) + u'Dovecot >= v1.1.2.'), VMM_ERROR) self._chk_state() assert isinstance(quotalimit, QuotaLimit) if quotalimit == self._qlimit: @@ -344,7 +345,7 @@ if transport.transport.lower() in ('virtual', 'virtual:') and \ not self._mail.postfix: raise AErr(_(u"Invalid transport '%(transport)s' for mailbox " - u"format '%(mbfmt)s'") % + u"format '%(mbfmt)s'.") % {'transport': transport, 'mbfmt': self._mail.mbformat}, INVALID_MAIL_LOCATION) self._update_tables('tid', transport.tid) @@ -475,7 +476,7 @@ info = dbc.fetchone() dbc.close() if not info: - raise AErr(_(u"There is no account with the UID '%d'.") % uid, + raise AErr(_(u"There is no account with the UID: '%d'") % uid, NO_SUCH_ACCOUNT) info = dict(zip(('address', 'uid', 'gid'), info)) return info diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/alias.py --- a/VirtualMailManager/alias.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/alias.py Thu Feb 24 20:47:35 2011 +0000 @@ -31,7 +31,7 @@ self._dbh = dbh self._gid = get_gid(self._dbh, self._addr.domainname) if not self._gid: - raise AErr(_(u"The domain '%s' doesn't exist.") % + raise AErr(_(u"The domain '%s' does not exist.") % self._addr.domainname, NO_SUCH_DOMAIN) self._dests = [] @@ -56,14 +56,14 @@ if dcount == limit or dcount + count_new > limit: failed = True errmsg = _( -u"""Can't add %(count_new)i new destination(s) to alias '%(address)s'. +u"""Cannot add %(count_new)i new destination(s) to alias '%(address)s'. Currently this alias expands into %(count)i/%(limit)i recipients. %(count_new)i additional destination(s) will render this alias unusable. Hint: Increase Postfix' virtual_alias_expansion_limit""") elif dcount > limit: failed = True errmsg = _( -u"""Can't add %(count_new)i new destination(s) to alias '%(address)s'. +u"""Cannot add %(count_new)i new destination(s) to alias '%(address)s'. This alias already exceeds its expansion limit (%(count)i/%(limit)i). So its unusable, all messages addressed to this alias will be bounced. Hint: Delete some destination addresses.""") @@ -138,10 +138,10 @@ """Deletes the specified ``destination`` address from the alias.""" assert isinstance(destination, EmailAddress) if not self._dests: - raise AErr(_(u"The alias '%s' doesn't exist.") % self._addr, + raise AErr(_(u"The alias '%s' does not exist.") % self._addr, NO_SUCH_ALIAS) if not destination in self._dests: - raise AErr(_(u"The address '%(addr)s' isn't a destination of " + raise AErr(_(u"The address '%(addr)s' is not a destination of " u"the alias '%(alias)s'.") % {'addr': self._addr, 'alias': destination}, NO_SUCH_ALIAS) self._delete(destination) @@ -150,14 +150,14 @@ def get_destinations(self): """Returns an iterator for all destinations of the alias.""" if not self._dests: - raise AErr(_(u"The alias '%s' doesn't exist.") % self._addr, + raise AErr(_(u"The alias '%s' does not exist.") % self._addr, NO_SUCH_ALIAS) return iter(self._dests) def delete(self): """Deletes the alias with all its destinations.""" if not self._dests: - raise AErr(_(u"The alias '%s' doesn't exist.") % self._addr, + raise AErr(_(u"The alias '%s' does not exist.") % self._addr, NO_SUCH_ALIAS) self._delete() del self._dests[:] diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/aliasdomain.py --- a/VirtualMailManager/aliasdomain.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/aliasdomain.py Thu Feb 24 20:47:35 2011 +0000 @@ -72,7 +72,7 @@ raise ADErr(_(u'No destination domain set for the alias domain.'), ALIASDOMAIN_NO_DOMDEST) if self._domain.gid < 1: - raise ADErr(_(u"The target domain '%s' doesn't exist.") % + raise ADErr(_(u"The target domain '%s' does not exist.") % self._domain.name, NO_SUCH_DOMAIN) dbc = self._dbh.cursor() dbc.execute('INSERT INTO domain_name (domainname, gid, is_primary) ' @@ -85,7 +85,7 @@ """Returns a dict (keys: "alias" and "domain") with the names of the AliasDomain and its primary domain.""" if self._gid < 1: - raise ADErr(_(u"The alias domain '%s' doesn't exist.") % + raise ADErr(_(u"The alias domain '%s' does not exist.") % self._name, NO_SUCH_ALIASDOMAIN) dbc = self._dbh.cursor() dbc.execute('SELECT domainname FROM domain_name WHERE gid = %s AND ' @@ -106,10 +106,10 @@ raise ADErr(_(u'No destination domain set for the alias domain.'), ALIASDOMAIN_NO_DOMDEST) if self._domain.gid < 1: - raise ADErr(_(u"The target domain '%s' doesn't exist.") % + raise ADErr(_(u"The target domain '%s' does not exist.") % self._domain.name, NO_SUCH_DOMAIN) if self._gid < 1: - raise ADErr(_(u"The alias domain '%s' doesn't exist.") % + raise ADErr(_(u"The alias domain '%s' does not exist.") % self._name, NO_SUCH_ALIASDOMAIN) if self._gid == self._domain.gid: raise ADErr(_(u"The alias domain '%(alias)s' is already assigned " @@ -130,7 +130,7 @@ Raises an AliasDomainError if the AliasDomain doesn't exist. """ if self._gid < 1: - raise ADErr(_(u"The alias domain '%s' doesn't exist.") % + raise ADErr(_(u"The alias domain '%s' does not exist.") % self._name, NO_SUCH_ALIASDOMAIN) dbc = self._dbh.cursor() dbc.execute('DELETE FROM domain_name WHERE domainname = %s AND NOT ' diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/cli/__init__.py --- a/VirtualMailManager/cli/__init__.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/cli/__init__.py Thu Feb 24 20:47:35 2011 +0000 @@ -88,11 +88,11 @@ clear1 = getpass(prompt=readp_msg1) if clear0 != clear1: failures += 1 - w_err(0, _(u'Sorry, passwords do not match')) + w_err(0, _(u'Sorry, passwords do not match.')) continue if not clear0: failures += 1 - w_err(0, _(u'Sorry, empty passwords are not permitted')) + w_err(0, _(u'Sorry, empty passwords are not permitted.')) continue mismatched = False return clear0 diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/cli/handler.py --- a/VirtualMailManager/cli/handler.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/cli/handler.py Thu Feb 24 20:47:35 2011 +0000 @@ -90,7 +90,7 @@ password dialog.""" acc = self._get_account(emailaddress) if not acc: - raise VMMError(_(u"The account '%s' doesn't exist.") % + raise VMMError(_(u"The account '%s' does not exist.") % acc.address, NO_SUCH_ACCOUNT) if not isinstance(password, basestring) or not password: password = read_pass() diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/cli/main.py --- a/VirtualMailManager/cli/main.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/cli/main.py Thu Feb 24 20:47:35 2011 +0000 @@ -36,7 +36,7 @@ def run(argv): if len(argv) < 2: - usage(EX_MISSING_ARGS, _(u"You must specify a subcommand at least")) + usage(EX_MISSING_ARGS, _(u"You must specify a subcommand at least.")) sub_cmd = argv[1].lower() if sub_cmd in cmd_map: @@ -65,7 +65,8 @@ except (BadOptionError, ConfigValueError), err: w_err(INVALID_ARGUMENT, _(u'Error: %s') % err) except NoSectionError, err: - w_err(INVALID_ARGUMENT, _(u"Error: No section '%s'") % err.section) + w_err(INVALID_ARGUMENT, + _(u"Error: Unknown section: '%s'") % err.section) except NoOptionError, err: w_err(INVALID_ARGUMENT, _(u"Error: No option '%(option)s' in section: '%(section)s'") % diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Thu Feb 24 20:47:35 2011 +0000 @@ -343,7 +343,7 @@ def get_user(ctx): """get the address of the user with the given UID""" if ctx.argc < 3: - usage(EX_MISSING_ARGS, _(u'Missing userid.'), ctx.scmd) + usage(EX_MISSING_ARGS, _(u'Missing UID.'), ctx.scmd) _print_info(ctx, ctx.hdlr.user_by_uid(ctx.args[2]), _(u'Account')) diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/domain.py --- a/VirtualMailManager/domain.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/domain.py Thu Feb 24 20:47:35 2011 +0000 @@ -111,7 +111,7 @@ """Throws a DomainError if the Domain is new - not saved in the database.""" if self._new: - raise DomErr(_(u"The domain '%s' doesn't exist.") % self._name, + raise DomErr(_(u"The domain '%s' does not exist.") % self._name, NO_SUCH_DOMAIN) def _update_tables(self, column, value, force=False): @@ -269,7 +269,7 @@ """ if cfg_dget('misc.dovecot_version') < 0x10102f00: raise VMMError(_(u'PostgreSQL-based dictionary quota requires ' - u'Dovecot >= v1.1.2'), VMM_ERROR) + u'Dovecot >= v1.1.2.'), VMM_ERROR) self._chk_state() assert isinstance(quotalimit, QuotaLimit) if not force and quotalimit == self._qlimit: diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/emailaddress.py --- a/VirtualMailManager/emailaddress.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/emailaddress.py Thu Feb 24 20:47:35 2011 +0000 @@ -68,16 +68,16 @@ parts = address.split('@') p_len = len(parts) if p_len < 2: - raise EAErr(_(u"Missing the '@' sign in address '%s'") % address, + raise EAErr(_(u"Missing the '@' sign in address: '%s'") % address, INVALID_ADDRESS) elif p_len > 2: - raise EAErr(_(u"Too many '@' signs in address '%s'") % address, + raise EAErr(_(u"Too many '@' signs in address: '%s'") % address, INVALID_ADDRESS) if not parts[0]: - raise EAErr(_(u"Missing local-part in address '%s'") % address, + raise EAErr(_(u"Missing local-part in address: '%s'") % address, LOCALPART_INVALID) if not parts[1]: - raise EAErr(_(u"Missing domain name in address '%s'") % address, + raise EAErr(_(u"Missing domain name in address: '%s'") % address, DOMAIN_NO_NAME) self._localpart = check_localpart(parts[0]) self._domainname = check_domainname(parts[1]) @@ -121,7 +121,7 @@ invalid characters. """ if len(localpart) > 64: - raise EAErr(_(u"The local-part '%s' is too long") % localpart, + raise EAErr(_(u"The local-part '%s' is too long.") % localpart, LOCALPART_TOO_LONG) invalid_chars = set(RE_LOCALPART.findall(localpart)) if invalid_chars: diff -r f32b323fd347 -r 8209da83e256 VirtualMailManager/ext/postconf.py --- a/VirtualMailManager/ext/postconf.py Thu Feb 24 01:02:24 2011 +0000 +++ b/VirtualMailManager/ext/postconf.py Thu Feb 24 20:47:35 2011 +0000 @@ -81,7 +81,7 @@ """Check that the `parameter` looks like a configuration parameter. If not, a VMMError will be raised.""" if not self.__class__._parameter_re.match(parameter): |
|
From: <nev...@us...> - 2011-02-24 01:02:37
|
details: http://hg.localdomain.org/vmm/rev/f32b323fd347 changeset: 416:f32b323fd347 user: Pascal Volk date: Thu Feb 24 01:02:24 2011 +0000 description: man: Replaced unnecessary \(aq glyphs in man1/vmm.1. Updated COPYING section in man1/vmm.1 and man5/vmm.cfg.5. diffstat: man/man1/vmm.1 | 53 +++++++++++++++++++++++++---------------------------- man/man5/vmm.cfg.5 | 8 +++----- 2 files changed, 28 insertions(+), 33 deletions(-) diffs (209 lines): diff -r c7a963e6cf6e -r f32b323fd347 man/man1/vmm.1 --- a/man/man1/vmm.1 Tue Feb 22 22:29:58 2011 +0000 +++ b/man/man1/vmm.1 Thu Feb 24 01:02:24 2011 +0000 @@ -1,4 +1,4 @@ -.TH "VMM" "1" "2011-02-22" "vmm 0.6" "vmm" +.TH "VMM" "1" "2011-02-24" "vmm 0.6" "vmm" .SH NAME vmm \- command line tool to manage email domains/accounts/aliases .\" ----------------------------------------------------------------------- @@ -13,7 +13,7 @@ and relocated users. It allows you to simply and quickly administer your mail server. .br -It\(aqs designed for Dovecot and Postfix with a PostgreSQL backend. +It's designed for Dovecot and Postfix with a PostgreSQL backend. .PP Each .I subcommand @@ -110,13 +110,12 @@ .B vmm configset .I option value .PP -Use this subcommand to set or update a single configuration option\(aqs -value. +Use this subcommand to set or update a single configuration option's value. .I option is the configuration option, .I value is the -.IR option \(aqs +.IR option 's new value. .IP Note: This subcommand will create a new @@ -188,7 +187,7 @@ .B vmm configure mailbox Using configuration file: /usr/local/etc/vmm.cfg -* Configuration section: \(aqmailbox\(aq +* Configuration section: `mailbox' Enter new value for option folders [Drafts:Sent:Templates:Trash]: Enter new value for option format [maildir]: mdbox Enter new value for option subscribe [True]: @@ -202,7 +201,7 @@ .I uid is available, for example from process list, the subcommand .B getuser -will show the user\(aqs address. +will show the user's address. .PP Example: .PP @@ -234,8 +233,8 @@ .RI [ pattern ] .PP This subcommand lists all available domains. -All domain names will be prefixed either with `[+]\(aq, if the domain is a -primary domain, or with `[-]\(aq, if it is an alias domain name. +All domain names will be prefixed either with `[+]', if the domain is a +primary domain, or with `[-]', if it is an alias domain name. The output can be limited with an optional .IR pattern . .PP @@ -260,7 +259,7 @@ .B vmm version .PP Prints -.BR vmm \(aqs +.BR vmm 's version and copyright information to stdout. After this .B vmm @@ -368,10 +367,10 @@ Domain information ------------------ Domainname.....: sales.example.com - GID............: 70693 + GID............: 70698 Transport......: dovecot: - Domaindir......: /home/mail/v/70693 - Quota Limit....: Storage: 0 Messages 0 + Domaindir......: /srv/mail/k/70698 + Quota Limit....: Storage: 0; Messages: 0 Aliasdomains...: 0 Accounts.......: 1 Aliases........: 0 @@ -527,7 +526,7 @@ Examples: .PP .nf -.B vmm ua d....@ex... \(aqA 5ecR3t P4s5\(rs/\(rs/0rd\(aq +.B vmm ua d....@ex... \(dqA 5ecR3t P4s5\(rs/\(rs/0rd\(dq .B vmm useradd e....@ex... Enter new password: Retype new password: @@ -551,7 +550,7 @@ .RI [ "service ..." ] .PP If a user should not be able to access one or more services you can -restrict the user\(aqs access with this subcommand. +restrict the user's access with this subcommand. .PP If no .I service @@ -608,7 +607,7 @@ .I address .TP .B du -to display the disk usage of the user\(aqs mail directory. +to display the disk usage of the user's mail directory. In order to summarize the disk usage each time the this subcommand is executed automatically, set .I account.disk_usage @@ -644,7 +643,7 @@ .SS username (un) .BI "vmm username" " address name" .PP -The user\(aqs real +The user's real .I name can be set/updated with this subcommand. .PP @@ -669,7 +668,7 @@ Example: .PP .nf -.B vmm up d....@ex... \(aqA |\(rs/|0r3 5ecur3 P4s5\(rs/\(rs/0rd?\(aq +.B vmm up d....@ex... \(dqA |\(rs/|0r3 5ecur3 P4s5\(rs/\(rs/0rd?\(dq .fi .\" ------------------------------------ .SS userquota (uq) @@ -699,14 +698,14 @@ .PP Example: .br -Assumed you want to use Dovecot\(aqs +Assumed you want to use Dovecot's .BR dsync (1) -to convert a user\(aqs mailbox from Maildir format to mdbox format, you +to convert a user's mailbox from Maildir format to mdbox format, you can tell Postfix to retry later. .PP .nf .B vmm ut d....@ex... \(dqretry:4.0.0 Mailbox being migrated\(dq -# convert the mailbox ... then set the transport to Dovecot\(aqs lmtp +# convert the mailbox ... then set the transport to Dovecot's lmtp .B vmm ut d....@ex... lmtp:unix:private/dovecot\-lmtp .fi .\" ----------------------------------------------------------------------- @@ -769,7 +768,7 @@ A new relocated user can be created with this subcommand. .PP .I address -is the user\(aqs ex\-email address, for example b....@ex..., and +is the user's ex\-email address, for example b....@ex..., and .I newaddress points to the new email address where the user can be reached. .PP @@ -791,7 +790,7 @@ .B vmm relocatedinfo b....@ex... Relocated information --------------------- - User \(aqb...@ex...\(aq has moved to \(aqb\-us...@co...\(aq + User `b....@ex...' has moved to `b\-us...@co...' .fi .\" ------------------------------------ .SS relocateddelete (rd) @@ -812,7 +811,7 @@ will be used when found. .TP .I /usr/local/etc/vmm.cfg -will be used when the above file doesn\(aqt exist. +will be used when the above file doesn't exist. .TP .I /etc/vmm.cfg will be used when none of the both above mentioned files exists. @@ -834,7 +833,5 @@ http://sf.net/tracker/?group_id=213727&atid=1026862 .\" ----------------------------------------------------------------------- .SH COPYING -.B vmm -and its man pages were written by Pascal Volk -.RI < nev...@us... > -and are licensed under the terms of the BSD License. \ No newline at end of file +vmm and its manual pages were written by Pascal Volk <neverseen AT +users.sourceforge.net> and are licensed under the terms of the BSD License. \ No newline at end of file diff -r c7a963e6cf6e -r f32b323fd347 man/man5/vmm.cfg.5 --- a/man/man5/vmm.cfg.5 Tue Feb 22 22:29:58 2011 +0000 +++ b/man/man5/vmm.cfg.5 Thu Feb 24 01:02:24 2011 +0000 @@ -1,4 +1,4 @@ -.TH "VMM.CFG" "5" "2011-02-22" "vmm 0.6" "vmm" +.TH "VMM.CFG" "5" "2011-02-24" "vmm 0.6" "vmm" .SH NAME vmm.cfg \- configuration file for vmm .\" ----------------------------------------------------------------------- @@ -565,7 +565,5 @@ http://sf.net/tracker/?group_id=213727&atid=1026862 .\" ----------------------------------------------------------------------- .SH COPYING -.B vmm -and its man pages were written by Pascal Volk -.RI < nev...@us... > -and are licensed under the terms of the BSD License. \ No newline at end of file +vmm and its manual pages were written by Pascal Volk <neverseen AT +users.sourceforge.net> and are licensed under the terms of the BSD License. \ No newline at end of file |
|
From: <nev...@us...> - 2011-02-22 22:30:58
|
details: http://hg.localdomain.org/vmm/rev/c7a963e6cf6e changeset: 415:c7a963e6cf6e user: Pascal Volk date: Tue Feb 22 22:29:58 2011 +0000 description: VMM/mailbox: Use the correct mailbox hierarchy separator in Mailbox.add_boxes() for mdbox and sdbox mailbox format. diffstat: VirtualMailManager/mailbox.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diffs (21 lines): diff -r ae1a8428298c -r c7a963e6cf6e VirtualMailManager/mailbox.py --- a/VirtualMailManager/mailbox.py Tue Feb 22 20:41:16 2011 +0000 +++ b/VirtualMailManager/mailbox.py Tue Feb 22 22:29:58 2011 +0000 @@ -128,7 +128,7 @@ name.startswith('../'): bad.append(name) return - if '/' in name or '..' in name: + elif '/' in name or '..' in name: bad.append(name) return if not self.__class__._box_name_re.match(name): @@ -155,6 +155,8 @@ good = set() bad = [] for box in mailboxes: + if self._sep == '/': + box = box.replace('.', self._sep) self._validate_box_name(box, good, bad) self._add_boxes(good, subscribe) return bad |
|
From: <nev...@us...> - 2011-02-22 20:41:28
|
details: http://hg.localdomain.org/vmm/rev/ae1a8428298c changeset: 414:ae1a8428298c user: Pascal Volk date: Tue Feb 22 20:41:16 2011 +0000 description: VMM: Report quota usage/limit/percentage values formatted according to the current LC_ALL setting. diffstat: VirtualMailManager/cli/subcommands.py | 15 +++++++++------ VirtualMailManager/common.py | 8 +++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diffs (66 lines): diff -r e5b3b225bd5b -r ae1a8428298c VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Tue Feb 22 20:12:18 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Tue Feb 22 20:41:16 2011 +0000 @@ -257,13 +257,16 @@ else: raise else: - q_limit = u'Storage: %(bytes)s; Messages: %(messages)u' + q_limit = u'Storage: %(bytes)s; Messages: %(messages)s' if not details: info['bytes'] = human_size(info['bytes']) + info['messages'] = locale.format('%d', info['messages'], True) info['quota limit'] = q_limit % info _print_info(ctx, info, _(u'Domain')) else: info[0]['bytes'] = human_size(info[0]['bytes']) + info[0]['messages'] = locale.format('%d', info[0]['messages'], + True) info[0]['quota limit'] = q_limit % info[0] _print_info(ctx, info[0], _(u'Domain')) if details == u'accounts': @@ -751,14 +754,14 @@ } else: q_usage = { - 'used': used, - 'limit': limit, + 'used': locale.format('%d', used, True), + 'limit': locale.format('%d', limit, True), } if limit: - q_usage['percent'] = 100. / limit * used + q_usage['percent'] = locale.format('%6.2f', 100. / limit * used, True) else: - q_usage['percent'] = 0. - return _(u'[%(percent)6.2f%%] %(used)s/%(limit)s') % q_usage + q_usage['percent'] = locale.format('%6.2f', 0, True) + return _(u'[%(percent)s%%] %(used)s/%(limit)s') % q_usage def _print_info(ctx, info, title): diff -r e5b3b225bd5b -r ae1a8428298c VirtualMailManager/common.py --- a/VirtualMailManager/common.py Tue Feb 22 20:12:18 2011 +0000 +++ b/VirtualMailManager/common.py Tue Feb 22 20:41:16 2011 +0000 @@ -8,6 +8,7 @@ Some common functions """ +import locale import os import re import stat @@ -82,9 +83,10 @@ (_(u'MiB'), 1 << 20), (_(u'KiB'), 1 << 10)) for prefix, multiply in prefix_multiply: if size >= multiply: - # TP: e.g.: '%(size).2f %(prefix)s' -> '118.30 MiB' - return _(u'%(size).2f %(prefix)s') % { - 'size': float(size) / multiply, + # TP: e.g.: '%(size)s %(prefix)s' -> '118.30 MiB' + return _(u'%(size)s %(prefix)s') % { + 'size': locale.format('%.2f', float(size) / multiply, + True), 'prefix': prefix} |
|
From: <nev...@us...> - 2011-02-22 20:12:31
|
details: http://hg.localdomain.org/vmm/rev/e5b3b225bd5b changeset: 413:e5b3b225bd5b user: Pascal Volk date: Tue Feb 22 20:12:18 2011 +0000 description: VMM/cli/subcommands: Improved legibility of domaininfo's "quota limit" output a little bit. diffstat: VirtualMailManager/cli/subcommands.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 65687300ba19 -r e5b3b225bd5b VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Tue Feb 22 18:10:27 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Tue Feb 22 20:12:18 2011 +0000 @@ -257,7 +257,7 @@ else: raise else: - q_limit = u'Storage: %(bytes)s Messages %(messages)u' + q_limit = u'Storage: %(bytes)s; Messages: %(messages)u' if not details: info['bytes'] = human_size(info['bytes']) info['quota limit'] = q_limit % info |
|
From: <nev...@us...> - 2011-02-22 18:10:39
|
details: http://hg.localdomain.org/vmm/rev/65687300ba19 changeset: 412:65687300ba19 user: Pascal Volk date: Tue Feb 22 18:10:27 2011 +0000 description: man/man5: Reworked/updated vmm.cfg.5. Removed vmm.cfg.5.rst. diffstat: man/man5/vmm.cfg.5 | 987 +++++++++++++++++++++++++++--------------------- man/man5/vmm.cfg.5.rst | 453 ---------------------- 2 files changed, 557 insertions(+), 883 deletions(-) diffs (truncated from 1472 to 300 lines): diff -r 1ca025a5ce0c -r 65687300ba19 man/man5/vmm.cfg.5 --- a/man/man5/vmm.cfg.5 Tue Feb 22 15:43:25 2011 +0000 +++ b/man/man5/vmm.cfg.5 Tue Feb 22 18:10:27 2011 +0000 @@ -1,444 +1,571 @@ -.\" Man page generated from reStructeredText. -. -.TH VMM.CFG 5 "2010-01-18" "vmm-0.6.0" "vmm Manual" +.TH "VMM.CFG" "5" "2011-02-22" "vmm 0.6" "vmm" .SH NAME vmm.cfg \- configuration file for vmm -. -.nr rst2man-indent-level 0 -. -.de1 rstReportMargin -\\$1 \\n[an-margin] -level \\n[rst2man-indent-level] -level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -- -\\n[rst2man-indent0] -\\n[rst2man-indent1] -\\n[rst2man-indent2] -.. -.de1 INDENT -.\" .rstReportMargin pre: -. RS \\$1 -. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -. nr rst2man-indent-level +1 -.\" .rstReportMargin post: -.. -.de UNINDENT -. RE -.\" indent \\n[an-margin] -.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -.nr rst2man-indent-level -1 -.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -.. +.\" ----------------------------------------------------------------------- .SH SYNOPSIS -.sp vmm.cfg +.\" ----------------------------------------------------------------------- .SH DESCRIPTION -.sp -\fBvmm\fP(1) reads its configuration data from \fIvmm.cfg\fP. -.sp -The configuration file is split into multiple sections. A section starts with -the section name, enclosed in square brackets \(aq\fB[\fP\(aq and \(aq\fB]\fP\(aq, followed -by \(aq\fIoption\fP = \fIvalue\fP\(aq pairs: -.sp +.BR vmm (1) +reads its configuration data from +.IR vmm.cfg . +.PP +The configuration file is split into multiple sections. +A section starts with the section name, enclosed in square brackets +.RB ` [ "' and `" ] ', +followed by +.RI ` option " = " value ' +pairs. +.br +Whitespace around the `=' and at the end of a value is ignored. +Empty lines and lines starting with `#' or `;' will be ignored. +.PP +Each value uses one of the following data types: +.TP 8 +.I Boolean +to indicate if something is enabled/activated (true) or +disabled/deactivated (false). +.br +Accepted values for +.I true +are: +.BR 1 , " yes" , " true" " and " on . +.br +Accepted values for +.I false +are: +.BR 0 , " no" , " false" " and " off . +.TP +.I Int +an integer number, written without a fractional or decimal component. +.br +For example +.BR 1 , " 50" " or " 321 +are integers. +.TP +.I String +a sequence of characters and/or numbers. +.br +For example +.RB ` word "', `" "hello world" "' or `" /usr/bin/strings ' +are strings. +.PP +Most options have a default value, shown in parentheses after the option's +name. +In order to use a option's default setting, comment out the line, either +with a +.BR # " or " ; +or simply remove the setting from +.IR vmm.cfg . +.PP +A minimal +.I vmm.cfg +would be: +.PP .nf -.ft C [database] -host = 127.0.0.1 -.ft P +user = me +pass = xxxxxxxx + +[misc] +dovecot_version = 1.2.16 .fi -.sp -Whitespace around the \(aq=\(aq and at the end of a value is ignored. -.sp -Empty lines and lines starting with \(aq#\(aq or \(aq;\(aq will be ignored. -.sp -Each value uses one of the following data types: -.INDENT 0.0 -.IP \(bu 2 -. -\fIBoolean\fP to indicate if something is enabled/activated (true) or -disabled/deactivated (false). +.\" ----------------------------------------------------------------------- +.SH SEARCH ORDER +By default +.BR vmm (1) +looks for the +.I vmm.cfg +file in the following directories in the order listed: +.RS +.PD 0 +.TP +.I +/root +.TP +.I +/usr/local/etc +.TP +.I +/etc +.PD +.RE +.PP +The first configuration file found will be used. +.\" ----------------------------------------------------------------------- +.SH SECTION ACCOUNT +The options in the section +.B account +are used to specify user account related settings. +.SS account.delete_directory +.BR delete_directory " (default: false) :" +.I Boolean +.PP +Determines the behavior of +.BR vmm (1) +when an account is deleted (userdelete). +If this option is set to +.I true +the user's home directory will be deleted recursively. +.\" ------------------------------------ +.SS account.directory_mode +.BR directory_mode " (default: 448) :" +.I Int +.PP +Access mode for a user's home directory and all directories inside. +The value has to be specified in decimal (base 10) notation. +.br +For example: `drwx\-\-\-\-\-\-' \(-> octal 0700 \(-> decimal 448 +.\" ------------------------------------ +.SS account.disk_usage +.BR disk_usage " (default: false) :" +.I Boolean +.PP +Determines whether the disk usage of a user's mail directory always should +be summarized, using +.BR du (1), +and displayed with the account information (userinfo). +.PP +This could be slow on large Maildirs. +When you have enabled quotas, +.BR vmm 's +userinfo subcommand will also display the current quota usage of the +account. +You may also use userinfo's optional details\-argument +.BR du " or " full , +in order to display the current disk usage of an account's mail directory. +.\" ------------------------------------ +.SS account.imap +.BR imap " (default: true) :" +.I Boolean +.PP +Determines whether a newly created user can log in via IMAP. +.\" ------------------------------------ +.SS account.password_length +.BR password_length " (default: 8) :" +.I Int +.PP +Determines how many characters and/or numbers should be used for randomly +generated passwords. +Any value less than 8 will be increased to 8. +.\" ------------------------------------ +.SS account.pop3 +.BR pop3 " (default: true) :" +.I Boolean +.PP +Determines whether a newly created user can log in via POP3. +.\" ------------------------------------ +.SS account.random_password +.BR random_password " (default: false) :" +.I Boolean +.PP +Determines whether +.BR vmm (1) +should generate a random password when no password was given for the +useradd subcommand. +If this option is set to +.I false +.B vmm +will prompt you to enter a password for the new account. +.PP +You can specify the password length of generated passwords with the +.I account.password_length +option. +.\" ------------------------------------ +.SS account.sieve +.BR sieve " (default: true) :" +.I Boolean +.PP +Determines whether a newly created user can log in via ManageSieve. +.\" ------------------------------------ +.SS account.smtp +.BR smtp " (default: true) :" +.I Boolean +.PP +Determines whether a newly created user can log in via SMTP (SMTP AUTH). +.\" ----------------------------------------------------------------------- +.SH SECTION BIN +The +.B bin +section is used to specify some paths to some binaries required by +.BR vmm (1). +.SS bin.dovecotpw +.BR dovecotpw " (default: /usr/sbin/dovecotpw) :" +.I String +.PP +The absolute path to the +.BR dovecotpw (1) +binary. +Use the absolute path to the +.BR doveadm (1) +binary, if you are using Dovecot v2.0. +.PP +This binary is used to generate a password hash, if +.I misc.password_scheme +is set to one of `CRAM\-MD5', `HMAC\-MD5', `LANMAN', `OTP', `RPA' or +`SKEY'. +This binary will be also required if your Python installation doesn't +support the: +.IP \(bu 4 +md4 hash algorithm (hashlib + OpenSSL or PyCrypto) used for the password +schemes: `PLAIN\-MD4' and `NTLM' +.IP \(bu +sha256 hash algorithm (hashlib or PyCrypto \(>= 2.1.0alpha1) used for the +password schemes: `SHA256' and `SSHA256' +.IP \(bu +sha512 hash algorithm (hashlib) used for the password schemes: `SHA512' and +`SSHA512' +.PP +The +.BR doveadm (1) +binary is also used to create a user's INBOX and additional mailboxes +.RI ( mailbox.folders ), +when the +.I mailbox.format +is set to +.BR mdbox " or " sdbox . +.\" ------------------------------------ +.SS bin.du +.BR du " (default: /usr/bin/du) :" +.I String +.PP +The absolute path to +.BR du (1). +This binary is used to summarize the disk usage of a user's mail directory. +.\" ------------------------------------ +.SS bin.postconf +.BR postconf " (default: /usr/sbin/postconf) :" +.I String +.PP +The absolute path to Postfix' +.BR postconf (1). +This binary is required when +.BR vmm (1) +has to check for some Postfix settings, e.g. the |
|
From: <nev...@us...> - 2011-02-22 15:43:36
|
details: http://hg.localdomain.org/vmm/rev/1ca025a5ce0c changeset: 411:1ca025a5ce0c user: Pascal Volk date: Tue Feb 22 15:43:25 2011 +0000 description: man/man1: Small syntax fixes in vmm.1. diffstat: man/man1/vmm.1 | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diffs (22 lines): diff -r 2bc9c36c1387 -r 1ca025a5ce0c man/man1/vmm.1 --- a/man/man1/vmm.1 Mon Feb 21 18:19:14 2011 +0000 +++ b/man/man1/vmm.1 Tue Feb 22 15:43:25 2011 +0000 @@ -1,4 +1,4 @@ -.TH "VMM" "1" "2011-02-21" "vmm 0.6" "vmm" +.TH "VMM" "1" "2011-02-22" "vmm 0.6" "vmm" .SH NAME vmm \- command line tool to manage email domains/accounts/aliases .\" ----------------------------------------------------------------------- @@ -834,6 +834,7 @@ http://sf.net/tracker/?group_id=213727&atid=1026862 .\" ----------------------------------------------------------------------- .SH COPYING -\fBvmm\fP and its man pages were written by Pascal Volk -<\fIn...@us...\fP> and are licensed under the terms of the -BSD License. \ No newline at end of file +.B vmm +and its man pages were written by Pascal Volk +.RI < nev...@us... > +and are licensed under the terms of the BSD License. \ No newline at end of file |
|
From: <nev...@us...> - 2011-02-21 18:19:28
|
details: http://hg.localdomain.org/vmm/rev/2bc9c36c1387 changeset: 410:2bc9c36c1387 user: Pascal Volk date: Mon Feb 21 18:19:14 2011 +0000 description: man/man1: Reworked/updated vmm.1. Removed vmm.1.rst. reStructuredText was nice to edit but the generated output … diffstat: man/man1/vmm.1 | 1060 ++++++++++++++++++++++++++++++++++++--------------- man/man1/vmm.1.rst | 505 ------------------------ 2 files changed, 738 insertions(+), 827 deletions(-) diffs (truncated from 1683 to 300 lines): diff -r 54a89c19e534 -r 2bc9c36c1387 man/man1/vmm.1 --- a/man/man1/vmm.1 Fri Feb 18 16:14:07 2011 +0000 +++ b/man/man1/vmm.1 Mon Feb 21 18:19:14 2011 +0000 @@ -1,423 +1,839 @@ -.TH "VMM" "1" "17 Aug 2009" "Pascal Volk" +.TH "VMM" "1" "2011-02-21" "vmm 0.6" "vmm" .SH NAME vmm \- command line tool to manage email domains/accounts/aliases +.\" ----------------------------------------------------------------------- .SH SYNOPSIS .B vmm -\fIsubcommand\fP \fIobject\fP [ \fIargs\fP ] +.IR subcommand " [" "argument ..." ] +.\" ----------------------------------------------------------------------- .SH DESCRIPTION -\fBvmm\fP (Virtual Mail Manager) is a command line tool for -administrators/postmasters to manage domains, accounts and aliases. It's -designed for Dovecot and Postfix with a PostgreSQL backend. -.SH SUBCOMMANDS -Each subcommand has both a long and a short form. Both forms are case sensitive. -.SS GENERAL SUBCOMMANDS +.B vmm +(a virtual mail manager) is the easy to use command line tool for +administrators and postmasters to manage (alias) domains, accounts, aliases +and relocated users. +It allows you to simply and quickly administer your mail server. +.br +It\(aqs designed for Dovecot and Postfix with a PostgreSQL backend. +.PP +Each +.I subcommand +has both a long and a short form. +The short form is shown enclosed in parentheses. +Both forms are case sensitive. +.PP +Most of the +.IR subcommand s +take one or more +.IR argument s. +.\" ----------------------------------------------------------------------- +.SH ARGUMENTS +.TP 12 +.I address +The complete e\-mail address +.RI ( local\-part @ fqdn ) +of an user account, alias address or relocated user. +.\" -------------------------- .TP -\fBconfigure\fP (\fBcf\fP) [ \fIsection\fP ] -Starts the interactive configuration for all configuration sections. +.I destination +Is either an e\-mail +.I address +when used with +.IR "ALIAS SUBCOMMANDS" . +Or a +.I fqdn +when used with +.IR "ALIASDOMAIN SUBCOMMANDS" . +.\" -------------------------- +.TP +.I fqdn +The fully qualified domain name \- without the trailing dot \- of a domain +or alias domain. +.\" -------------------------- +.TP +.I messages +An integer value which specifies a quota limit in number of messages. +.B 0 +(zero) means unlimited \- no quota limit for the number of messages. +.\" -------------------------- +.TP +.I option +is the name of a configuration option, prefixed with the section name and a +dot. +For example: +.IB misc . transport .br -If the optional argument \fIsection\fP is given, only the configuration options -from the given section will be displayed and will be configurable. The following -sections are available: -.RS -.PD 0 +All configuration options are described in +.BR vmm.cfg (5). +.\" -------------------------- .TP -- -.B -database +.I service +The name of a service, commonly used with Dovecot. +Supported services are: +.BR imap ", " pop3 ", " sieve " and " smtp . +.\" -------------------------- .TP -- -.B -maildir +.I storage +Specifies a quota limit in bytes. +One of the following prefixes can be appended to the integer value: +.BR b " (bytes), " k " (kilobytes), " M " (megabytes) or " G +(gigabytes). +.B 0 +(zero) means unlimited \- no quota limit in bytes. +.\" -------------------------- .TP -- -.B -services -.TP -- -.B -domdir -.TP -- -.B -bin -.TP -- -.B -misc -.PD -.RE -.LP +.I transport +A transport for Postfix, written as: +.IB transport : +or +.IB transport :\c +.IR nexthop . +See +.BR transport (5) +for more details. +.\" ----------------------------------------------------------------------- +.SH GENERAL SUBCOMMANDS +.SS configget (cg) +.BI "vmm configget" " option" +.PP +This subcommand is used to display the actual value of the given +configuration +.IR option . +.PP +Example: .PP .nf - Example: - - \fBvmm configure services\fP - Using configuration file: /usr/local/etc/vmm.cfg - - * Config section: “services” - Enter new value for option pop3 [True]: - Enter new value for option smtp [True]: - Enter new value for option imap [True]: - Enter new value for option sieve [True]: false +.B vmm configget misc.crypt_sha512_rounds +misc.crypt_sha512_rounds = 5000 .fi +.\" ------------------------------------ +.SS configset (cs) +.B vmm configset +.I option value .PP -.TP -\fBgetuser\fP (\fBgu\fP) \fIuserid\fP -If only the userid is available, for example from process list, the subcommand -\fBgetuser\fP will show the user's address. +Use this subcommand to set or update a single configuration option\(aqs +value. +.I option +is the configuration option, +.I value +is the +.IR option \(aqs +new value. +.IP Note: +This subcommand will create a new +.I vmm.cfg +without any comments. +Your current configuration file will be backed as +.IR vmm.cfg.bak . +.PP +Example: .PP .nf - Example: - - \fBvmm getuser 70004\fP - Account information - ------------------- - UID............: 70004 - GID............: 70000 - Address........: c....@ex... +.B vmm configget misc.transport +misc.transport = dovecot: +.B vmm configset misc.transport lmtp:unix:private/dovecot\-lmtp +.B vmm cg misc.transport +misc.transport = lmtp:unix:private/dovecot\-lmtp .fi -.\" +.\" ------------------------------------ +.SS configure (cf) +.B vmm configure +.RI [ section ] +.PP +Starts the interactive configuration for all configuration sections. +.PP +In this process the currently set value of each option will be displayed in +square brackets. +If no value is configured, the default value of each option will be +displayed in square brackets. +Press the return key, to accept the displayed value. +.PP +If the optional argument +.I section +is given, only the configuration options from the given section will be +displayed and will be configurable. +The following sections are available: +.RS +.TP 10 +.B account +Account settings .TP -\fBlistdomains\fP (\fBld\fP) [ \fIpattern\fP ] -This subcommand lists all available domains. All domain names will be prefixed -either with '[+]', if the domain is a primary domain, or with '[-]', if it is -an alias domain name. The output can be limited with an optional \fIpattern\fP. -.br -To perform a wild card search, the % character can be used at the start and/or -the end of the \fIpattern\fP. +.B bin +Paths to external binaries +.TP +.B database +Database settings +.TP +.B domain +Domain settings +.TP +.B mailbox +Mailbox settings +.TP +.B misc +Miscellaneous settings +.RE +.PP +All configuration options are described in +.BR vmm.cfg (5). +.IP Note: +This subcommand will create a new +.I vmm.cfg +without any comments. +Your current configuration file will be backed as +.IR vmm.cfg.bak . +.PP +Example: .PP .nf - Example: +.B vmm configure mailbox +Using configuration file: /usr/local/etc/vmm.cfg - \fBvmm listdomains %example%\fP - Matching domains - ---------------- - [+] example.com - [-] e.g.example.com - [-] example.name - [+] example.net - [+] example.org +* Configuration section: \(aqmailbox\(aq +Enter new value for option folders [Drafts:Sent:Templates:Trash]: +Enter new value for option format [maildir]: mdbox +Enter new value for option subscribe [True]: +Enter new value for option root [Maildir]: mdbox .fi -.\" -.TP -\fBhelp\fP (\fBh\fP) -Prints all available commands to stdout. After this \fBvmm\fP exits. -.TP -\fBversion\fP (\fBv\fP) -Prints the version information from \fBvmm\fP. -.\" -.SS DOMAIN SUBCOMMANDS -.TP -\fBdomainadd\fP (\fBda\fP) \fIdomain\fP [ \fItransport\fP ] -Adds the new \fIdomain\fP into the database. -.br -If the optional argument \fItransport\fP is given, it will overwrite the -default transport from \fBvmm.cfg\fP (misc/transport). The specified transport +.\" ------------------------------------ +.SS getuser (gu) +.BI "vmm getuser" " uid" +.PP +If only the +.I uid +is available, for example from process list, the subcommand |
|
From: <nev...@us...> - 2011-02-18 16:14:19
|
details: http://hg.localdomain.org/vmm/rev/54a89c19e534 changeset: 409:54a89c19e534 user: Pascal Volk date: Fri Feb 18 16:14:07 2011 +0000 description: VMM/cli/subcommands: Update also the RunContext's subcommand if 'plan A' in {,alias}domain_info() fails. diffstat: VirtualMailManager/cli/subcommands.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r f6e55b27fe07 -r 54a89c19e534 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Fri Feb 18 12:36:09 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Fri Feb 18 16:14:07 2011 +0000 @@ -154,7 +154,7 @@ if err.code is ALIASDOMAIN_ISDOMAIN: w_err(0, ctx.plan_a_b % {'subcommand': u'domaininfo', 'object': ctx.args[2].lower()}) - ctx.args[1] = 'domaininfo' + ctx.scmd = ctx.args[1] = 'domaininfo' domain_info(ctx) else: raise @@ -252,7 +252,7 @@ if err.code is DOMAIN_ALIAS_EXISTS: w_err(0, ctx.plan_a_b % {'subcommand': u'aliasdomaininfo', 'object': ctx.args[2].lower()}) - ctx.args[1] = 'aliasdomaininfo' + ctx.scmd = ctx.args[1] = 'aliasdomaininfo' aliasdomain_info(ctx) else: raise |
|
From: <nev...@us...> - 2011-02-18 12:36:21
|
details: http://hg.localdomain.org/vmm/rev/f6e55b27fe07 changeset: 408:f6e55b27fe07 user: Pascal Volk date: Fri Feb 18 12:36:09 2011 +0000 description: VMM/cli/subcommands: Fixed a msgid issue (format string with unnamed arguments). diffstat: VirtualMailManager/cli/subcommands.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diffs (22 lines): diff -r 3162ff959375 -r f6e55b27fe07 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Fri Feb 18 12:12:54 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Fri Feb 18 12:36:09 2011 +0000 @@ -257,13 +257,14 @@ else: raise else: + q_limit = u'Storage: %(bytes)s Messages %(messages)u' if not details: - info['quota limit'] = _(u'Storage: %s Messages %u') % ( - human_size(info['bytes']), info['messages']) + info['bytes'] = human_size(info['bytes']) + info['quota limit'] = q_limit % info _print_info(ctx, info, _(u'Domain')) else: - info[0]['quota limit'] = _(u'Storage: %s Messages %u') % ( - human_size(info[0]['bytes']), info[0]['messages']) + info[0]['bytes'] = human_size(info[0]['bytes']) + info[0]['quota limit'] = q_limit % info[0] _print_info(ctx, info[0], _(u'Domain')) if details == u'accounts': _print_list(info[1], _(u'accounts')) |
|
From: <nev...@us...> - 2011-02-18 12:13:06
|
details: http://hg.localdomain.org/vmm/rev/3162ff959375 changeset: 407:3162ff959375 user: Pascal Volk date: Fri Feb 18 12:12:54 2011 +0000 description: VMM: Solve the default "misc.quota_bytes = '0'" problem where it may occur. diffstat: VirtualMailManager/handler.py | 2 +- VirtualMailManager/quotalimit.py | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diffs (24 lines): diff -r 58e23bd7c97f -r 3162ff959375 VirtualMailManager/handler.py --- a/VirtualMailManager/handler.py Fri Feb 18 01:15:03 2011 +0000 +++ b/VirtualMailManager/handler.py Fri Feb 18 12:12:54 2011 +0000 @@ -431,7 +431,7 @@ else: dom.set_transport(Transport(self._dbh, transport=transport)) dom.set_quotalimit(QuotaLimit(self._dbh, - bytes=self._cfg.dget('misc.quota_bytes'), + bytes=long(self._cfg.dget('misc.quota_bytes')), messages=self._cfg.dget('misc.quota_messages'))) dom.set_directory(self._cfg.dget('misc.base_directory')) dom.save() diff -r 58e23bd7c97f -r 3162ff959375 VirtualMailManager/quotalimit.py --- a/VirtualMailManager/quotalimit.py Fri Feb 18 01:15:03 2011 +0000 +++ b/VirtualMailManager/quotalimit.py Fri Feb 18 12:12:54 2011 +0000 @@ -55,8 +55,6 @@ self._load_by_qid(qid) else: bytes_, msgs = kwargs.get('bytes'), kwargs.get('messages') - if bytes_ == '0': # default from Config - bytes_ = 0 assert all(isinstance(i, (int, long)) for i in (bytes_, msgs)) if bytes_ < 0: self._bytes = -bytes_ |
|
From: <nev...@us...> - 2011-02-18 01:15:18
|
details: http://hg.localdomain.org/vmm/rev/58e23bd7c97f changeset: 406:58e23bd7c97f user: Pascal Volk date: Fri Feb 18 01:15:03 2011 +0000 description: VMM/cli/subcommands: Made argument names translatable. diffstat: VirtualMailManager/cli/subcommands.py | 67 ++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 31 deletions(-) diffs (122 lines): diff -r da80de422b3c -r 58e23bd7c97f VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Mon Feb 14 19:11:34 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Fri Feb 18 01:15:03 2011 +0000 @@ -625,82 +625,87 @@ cmd = Command cmd_map = { # {{{ # Account commands - 'getuser': cmd('getuser', 'gu', get_user, 'uid', + 'getuser': cmd('getuser', 'gu', get_user, _(u'uid'), _(u'get the address of the user with the given UID')), - 'useradd': cmd('useradd', 'ua', user_add, 'address [password]', + 'useradd': cmd('useradd', 'ua', user_add, _(u'address [password]'), _(u'create a new e-mail user with the given address')), - 'userdelete': cmd('userdelete', 'ud', user_delete, 'address [force]', + 'userdelete': cmd('userdelete', 'ud', user_delete, _(u'address [force]'), _(u'delete the specified user')), 'userdisable': cmd('userdisable', 'u0', user_disable, - 'address [service ...]', + _(u'address [service ...]'), _(u'deactivate all/the given service(s) for a user')), - 'userenable': cmd('userenable', 'u1', user_enable, 'address [service ...]', + 'userenable': cmd('userenable', 'u1', user_enable, + _(u'address [service ...]'), _(u'activate all or the given service(s) for a user')), - 'userinfo': cmd('userinfo', 'ui', user_info, 'address [details]', + 'userinfo': cmd('userinfo', 'ui', user_info, _(u'address [details]'), _(u'display information about the given address')), - 'username': cmd('username', 'un', user_name, 'address name', + 'username': cmd('username', 'un', user_name, _(u'address name'), _(u'set or update the real name for an address')), 'userpassword': cmd('userpassword', 'up', user_password, - 'address [password]', + _(u'address [password]'), _(u'update the password for the given address')), 'userquota': cmd('userquota', 'uq', user_quota, - 'address storage [messages]', + _(u'address storage [messages]'), _(u'update the quota limit for the given address')), 'usertransport': cmd('usertransport', 'ut', user_transport, - 'address transport', + _(u'address transport'), _(u'update the transport of the given address')), # Alias commands - 'aliasadd': cmd('aliasadd', 'aa', alias_add, 'address destination ...', - _(u'create a new alias e-mail address')), + 'aliasadd': cmd('aliasadd', 'aa', alias_add, _(u'address destination ...'), + _(u'create a new alias e-mail address with one or more ' + u'destinations')), 'aliasdelete': cmd('aliasdelete', 'ad', alias_delete, - 'address [destination]', + _(u'address [destination]'), _(u'delete the specified alias e-mail address or one ' u'of its destinations')), - 'aliasinfo': cmd('aliasinfo', 'ai', alias_info, 'address', + 'aliasinfo': cmd('aliasinfo', 'ai', alias_info, _(u'address'), _(u'show the destination(s) of the specified alias')), # AliasDomain commands 'aliasdomainadd': cmd('aliasdomainadd', 'ada', aliasdomain_add, - 'fqdn destination', + _(u'fqdn destination'), _(u'create a new alias for an existing domain')), 'aliasdomaindelete': cmd('aliasdomaindelete', 'add', aliasdomain_delete, - 'fqdn', _(u'delete the specified alias domain')), - 'aliasdomaininfo': cmd('aliasdomaininfo', 'adi', aliasdomain_info, 'fqdn', + _(u'fqdn'), + _(u'delete the specified alias domain')), + 'aliasdomaininfo': cmd('aliasdomaininfo', 'adi', aliasdomain_info, + _(u'fqdn'), _(u'show the destination of the given alias domain')), 'aliasdomainswitch': cmd('aliasdomainswitch', 'ads', aliasdomain_switch, - 'fqdn destination', + _(u'fqdn destination'), _(u'assign the given alias domain to an other domain')), # Domain commands - 'domainadd': cmd('domainadd', 'da', domain_add, 'fqdn [transport]', + 'domainadd': cmd('domainadd', 'da', domain_add, _(u'fqdn [transport]'), _(u'create a new domain')), - 'domaindelete': cmd('domaindelete', 'dd', domain_delete, 'fqdn [force]', + 'domaindelete': cmd('domaindelete', 'dd', domain_delete, + _(u'fqdn [force]'), _(u'delete the given domain and all its alias domains')), - 'domaininfo': cmd('domaininfo', 'di', domain_info, 'fqdn [details]', + 'domaininfo': cmd('domaininfo', 'di', domain_info, _(u'fqdn [details]'), _(u'display information about the given domain')), 'domainquota': cmd('domainquota', 'dq', domain_quota, - 'fqdn storage [messages] [force]', + _(u'fqdn storage [messages] [force]'), _(u'update the quota limit of the specified domain')), 'domaintransport': cmd('domaintransport', 'dt', domain_transport, - 'fqdn transport [force]', + _(u'fqdn transport [force]'), _(u'update the transport of the specified domain')), - 'listdomains': cmd('listdomains', 'ld', list_domains, '[pattern]', + 'listdomains': cmd('listdomains', 'ld', list_domains, _(u'[pattern]'), _(u'list all domains / search domains by pattern')), # Relocated commands 'relocatedadd': cmd('relocatedadd', 'ra', relocated_add, - 'address newaddress', + _(u'address newaddress'), _(u'create a new record for a relocated user')), 'relocateddelete': cmd('relocateddelete', 'rd', relocated_delete, - 'address', + _(u'address'), _(u'delete the record of the relocated user')), - 'relocatedinfo': cmd('relocatedinfo', 'ri', relocated_info, 'address', + 'relocatedinfo': cmd('relocatedinfo', 'ri', relocated_info, _('address'), _(u'print information about a relocated user')), # cli commands - 'configget': cmd('configget', 'cg', config_get, 'option', + 'configget': cmd('configget', 'cg', config_get, _(u'option'), _('show the actual value of the configuration option')), - 'configset': cmd('configset', 'cs', config_set, 'option value', + 'configset': cmd('configset', 'cs', config_set, _('option value'), _('set a new value for the configuration option')), - 'configure': cmd('configure', 'cf', configure, '[section]', + 'configure': cmd('configure', 'cf', configure, _(u'[section]'), _(u'start interactive configuration modus')), - 'help': cmd('help', 'h', help_, '[subcommand]', + 'help': cmd('help', 'h', help_, _(u'[subcommand]'), _(u'show a help overview or help for the given subcommand')), 'version': cmd('version', 'v', version, '', _(u'show version and copyright information')), |
|
From: <nev...@us...> - 2011-02-14 19:11:47
|
details: http://hg.localdomain.org/vmm/rev/da80de422b3c changeset: 405:da80de422b3c user: Pascal Volk date: Mon Feb 14 19:11:34 2011 +0000 description: man1/vmm.1.rst: Added subcommands domainquota and userquota. Updated description of subcommand aliasadd. diffstat: man/de/man1/vmm.1.rst | 54 ++++++++++++++++++++++++++++++++++++++++++--- man/man1/vmm.1.rst | 51 ++++++++++++++++++++++++++++++++++++++++--- man/substitute_links_1.rst | 4 +++ 3 files changed, 101 insertions(+), 8 deletions(-) diffs (175 lines): diff -r 0c52094447b0 -r da80de422b3c man/de/man1/vmm.1.rst --- a/man/de/man1/vmm.1.rst Sun Feb 13 05:01:04 2011 +0000 +++ b/man/de/man1/vmm.1.rst Mon Feb 14 19:11:34 2011 +0000 @@ -200,6 +200,32 @@ Aliases........: 0 Relocated......: 0 +.. _domainquota: + +``domainquota (dq) Domain Speicher [Nachrichten] [force]`` + Dieser Unterbefehl wird verwendet, um für die Konten der *Domain* ein + neues Quota-Limit festzulegen. + + Standardmäßig gilt für Konten das Quota-Limit der *vmm.cfg* + (|misc.quota_bytes|_ und |misc.quota_messages|_). Das neue Quota-Limit + wird für alle zukünftig angelegte Konten gelten. Soll das neue Quota + Limit auch auf bestehende Konten der *Domain* angewendet werden, ist das + optionale Schlüsselwort **force** anzugeben. + + ``Speicher`` + Bestimmt das Quota-Limit in Bytes. Eines der Präfixe **b** (Bytes), + **k** (Kilobytes), **M** (Megabytes), oder **G** (Gigabytes) kann an das + ganzzahlige Limit angehängt werden. **0** steht für unbegrenzt - kein + Quota-Limit in Bytes. + ``Nachrichten`` + Legt das Quota-Limit als Anzahl von Nachrichten fest. Wurde dieses + optionale Argument ausgelassen, wird das Nachrichten Limit auf 0 gesetzt. + **0** steht für unbegrenzt - kein Quota-Limit als Anzahl von Nachrichten. + + Beispiel:: + + vmm domainquota example.com 1g force + .. _domaintransport: ``domaintransport (dt) Domain Transport [ force ]`` @@ -345,6 +371,26 @@ vmm up d....@ex... 'A |\\/|0r3 5ecur3 P4s5\\/\\/0rd?' +.. _userquota: + +``userquota (uq) Adresse Speicher [Nachrichten]`` + Um ein neues Quota-Limit für das Konto mit der angegebenen *Adresse* + festzulegen wird dieser Unterbefehl verwendet. + + ``Speicher`` + Bestimmt das Quota-Limit in Bytes. Eines der Präfixe **b** (Bytes), + **k** (Kilobytes), **M** (Megabytes), oder **G** (Gigabytes) kann an das + ganzzahlige Limit angehängt werden. **0** steht für unbegrenzt - kein + Quota-Limit in Bytes. + ``Nachrichten`` + Legt das Quota-Limit als Anzahl von Nachrichten fest. Wurde dieses + optionale Argument ausgelassen, wird das Nachrichten Limit auf 0 gesetzt. + **0** steht für unbegrenzt - kein Quota-Limit als Anzahl von Nachrichten. + + Beispiel:: + + vmm userquota d....@ex... 750m + .. _usertransport: ``usertransport (ut) Adresse Transport`` @@ -403,14 +449,14 @@ ------------------ .. _aliasadd: -``aliasadd (aa) Alias Ziel`` - Mit diesem Unterbefehl werden neue Aliase erstellt. +``aliasadd (aa) Alias Ziel ...`` + Mit diesem Unterbefehl werden neue *Alias*\ -Adressen, mit einer oder + mehren *Ziel*\ -Adressen, erstellt. Beispiele:: vmm aliasadd joh...@ex... d....@ex... - vmm aa su...@ex... d....@ex... - vmm aa su...@ex... e....@ex... + vmm aa su...@ex... d....@ex... e....@ex... .. _aliasinfo: diff -r 0c52094447b0 -r da80de422b3c man/man1/vmm.1.rst --- a/man/man1/vmm.1.rst Sun Feb 13 05:01:04 2011 +0000 +++ b/man/man1/vmm.1.rst Mon Feb 14 19:11:34 2011 +0000 @@ -192,6 +192,31 @@ Aliases........: 0 Relocated......: 0 +.. _domainquota: + +``domainquota (dq) domain storage [messages] [force]`` + This subcommand is used to configure a new quota limit for the accounts + of *domain* - not for the *domain* itself. + + The default quota limit for accounts is defined in the *vmm.cfg* + (|misc.quota_bytes|_ and |misc.quota_messages|_). The new quota limit + will be applied to all newly created accounts. If you want to apply the + new quota limit also to existing accounts, you have to give the optional + keyword **force**. + + ``storage`` + specifies the quota limit in bytes. One of the prefixes can be appended + to the integer value: **b** (bytes), **k** (kilobytes), **M** + (megabytes) or **G** (gigabytes). **0** means unlimited - no quota limit. + ``messages`` + this optional argument specifies the quota limit in number of messages. + When it was omitted the messages limit will be set to 0. **0** means + unlimited - no quota limit. + + Example:: + + vmm domainquota example.com 1g force + .. _domaintransport: ``domaintransport (dt) domain transport [ force ]`` @@ -323,6 +348,24 @@ vmm up d....@ex... 'A |\\/|0r3 5ecur3 P4s5\\/\\/0rd?' +.. _userquota: + +``userquota (uq) address storage [messages]`` + This subcommand is used to set a new quota limit for the given account. + + ``storage`` + specifies the quota limit in bytes. One of the prefixes can be appended + to the integer value: **b** (bytes), **k** (kilobytes), **M** + (megabytes) or **G** (gigabytes). **0** means unlimited - no quota limit. + ``messages`` + this optional argument specifies the quota limit in number of messages. + When it was omitted the messages limit will be set to 0. **0** means + unlimited - no quota limit. + + Example:: + + vmm userquota d....@ex... 750m + .. _usertransport: ``usertransport (ut) address transport`` @@ -371,14 +414,14 @@ ----------------- .. _aliasadd: -``aliasadd (aa) alias target`` - This subcommand is used to create a new alias. +``aliasadd (aa) alias target ...`` + This subcommand is used to create a new alias with one or more *target* + addresses. Examples:: vmm aliasadd joh...@ex... d....@ex... - vmm aa su...@ex... d....@ex... - vmm aa su...@ex... e....@ex... + vmm aa su...@ex... d....@ex... e....@ex... .. _aliasinfo: diff -r 0c52094447b0 -r da80de422b3c man/substitute_links_1.rst --- a/man/substitute_links_1.rst Sun Feb 13 05:01:04 2011 +0000 +++ b/man/substitute_links_1.rst Mon Feb 14 19:11:34 2011 +0000 @@ -10,6 +10,10 @@ .. |domain.force_deletion| replace:: `domain.force_deletion` .. _domain.force_deletion: vmm.cfg.5#domain-force-deletion +.. |misc.quota_bytes| replace:: `misc.quota_bytes` +.. _misc.quota_bytes: vmm.cfg.5#misc-quota-bytes +.. |misc.quota_messages| replace:: `misc.quota_messages` +.. _misc.quota_messages: vmm.cfg.5#misc-quota-messages .. |misc.transport| replace:: `misc.transport` .. _misc.transport: vmm.cfg.5#misc-transport |
|
From: <nev...@us...> - 2011-02-13 05:01:17
|
details: http://hg.localdomain.org/vmm/rev/0c52094447b0 changeset: 404:0c52094447b0 user: Pascal Volk date: Sun Feb 13 05:01:04 2011 +0000 description: VMM/{account,domain}: Added a versions check to the update_quotalimit methods of classes Account and Domain. diffstat: VirtualMailManager/account.py | 7 +++++-- VirtualMailManager/domain.py | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diffs (62 lines): diff -r a4f5d4cd886d -r 0c52094447b0 VirtualMailManager/account.py --- a/VirtualMailManager/account.py Sun Feb 13 04:33:55 2011 +0000 +++ b/VirtualMailManager/account.py Sun Feb 13 05:01:04 2011 +0000 @@ -16,8 +16,8 @@ from VirtualMailManager.constants import \ ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_PRESENT, \ INVALID_ARGUMENT, INVALID_MAIL_LOCATION, NO_SUCH_ACCOUNT, \ - NO_SUCH_DOMAIN, UNKNOWN_SERVICE -from VirtualMailManager.errors import AccountError as AErr + NO_SUCH_DOMAIN, UNKNOWN_SERVICE, VMM_ERROR +from VirtualMailManager.errors import VMMError, AccountError as AErr from VirtualMailManager.maillocation import MailLocation from VirtualMailManager.password import pwhash @@ -319,6 +319,9 @@ `quotalimit` : VirtualMailManager.quotalimit.QuotaLimit the new quota limit of the domain. """ + if cfg_dget('misc.dovecot_version') < 0x10102f00: + raise VMMError(_(u'PostgreSQL-based dictionary quota requires ' + u'Dovecot >= v1.1.2'), VMM_ERROR) self._chk_state() assert isinstance(quotalimit, QuotaLimit) if quotalimit == self._qlimit: diff -r a4f5d4cd886d -r 0c52094447b0 VirtualMailManager/domain.py --- a/VirtualMailManager/domain.py Sun Feb 13 04:33:55 2011 +0000 +++ b/VirtualMailManager/domain.py Sun Feb 13 05:01:04 2011 +0000 @@ -14,8 +14,8 @@ from VirtualMailManager.constants import \ ACCOUNT_AND_ALIAS_PRESENT, DOMAIN_ALIAS_EXISTS, DOMAIN_EXISTS, \ - DOMAIN_INVALID, DOMAIN_TOO_LONG, NO_SUCH_DOMAIN -from VirtualMailManager.errors import DomainError as DomErr + DOMAIN_INVALID, DOMAIN_TOO_LONG, NO_SUCH_DOMAIN, VMM_ERROR +from VirtualMailManager.errors import VMMError, DomainError as DomErr from VirtualMailManager.pycompat import all, any from VirtualMailManager.quotalimit import QuotaLimit from VirtualMailManager.transport import Transport @@ -24,6 +24,7 @@ MAILDIR_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz' RE_DOMAIN = re.compile(r"^(?:[a-z0-9-]{1,63}\.){1,}[a-z]{2,6}$") _ = lambda msg: msg +cfg_dget = lambda option: None class Domain(object): @@ -266,6 +267,9 @@ `force` : bool enforce new quota limit for all accounts, default `False` """ + if cfg_dget('misc.dovecot_version') < 0x10102f00: + raise VMMError(_(u'PostgreSQL-based dictionary quota requires ' + u'Dovecot >= v1.1.2'), VMM_ERROR) self._chk_state() assert isinstance(quotalimit, QuotaLimit) if not force and quotalimit == self._qlimit: @@ -459,4 +463,4 @@ domains[gid] = [None, domain] return gids, domains -del _ +del _, cfg_dget |
|
From: <nev...@us...> - 2011-02-13 04:34:12
|
details: http://hg.localdomain.org/vmm/rev/a4f5d4cd886d changeset: 403:a4f5d4cd886d user: Pascal Volk date: Sun Feb 13 04:33:55 2011 +0000 description: VMM/cli/subcommands: Implemented subcommands domainquota and userquota. diffstat: VirtualMailManager/cli/subcommands.py | 82 ++++++++++++++++++++++++++++++++-- 1 files changed, 76 insertions(+), 6 deletions(-) diffs (134 lines): diff -r 8984b1f4e6e3 -r a4f5d4cd886d VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Sun Feb 13 03:32:31 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sun Feb 13 04:33:55 2011 +0000 @@ -17,7 +17,7 @@ from VirtualMailManager import ENCODING from VirtualMailManager.account import SERVICES from VirtualMailManager.cli import get_winsize, prog, w_err, w_std -from VirtualMailManager.common import human_size, version_str +from VirtualMailManager.common import human_size, size_in_bytes, version_str from VirtualMailManager.constants import __copyright__, __date__, \ __version__, ACCOUNT_EXISTS, ALIAS_EXISTS, ALIASDOMAIN_ISDOMAIN, \ DOMAIN_ALIAS_EXISTS, INVALID_ARGUMENT, EX_MISSING_ARGS, RELOCATED_EXISTS @@ -27,10 +27,11 @@ 'Command', 'RunContext', 'cmd_map', 'usage', 'alias_add', 'alias_delete', 'alias_info', 'aliasdomain_add', 'aliasdomain_delete', 'aliasdomain_info', 'aliasdomain_switch', 'config_get', 'config_set', 'configure', - 'domain_add', 'domain_delete', 'domain_info', 'domain_transport', - 'get_user', 'help_', 'list_domains', 'relocated_add', 'relocated_delete', - 'relocated_info', 'user_add', 'user_delete', 'user_disable', 'user_enable', - 'user_info', 'user_name', 'user_password', 'user_transport', 'version', + 'domain_add', 'domain_delete', 'domain_info', 'domain_quota', + 'domain_transport', 'get_user', 'help_', 'list_domains', 'relocated_add', + 'relocated_delete', 'relocated_info', 'user_add', 'user_delete', + 'user_disable', 'user_enable', 'user_info', 'user_name', 'user_password', + 'user_quota', 'user_transport', 'version', ) _ = lambda msg: msg @@ -279,6 +280,45 @@ _print_list(info[4], _(u'relocated users')) +def domain_quota(ctx): + """update the quota limit of the specified domain""" + if ctx.argc < 3: + usage(EX_MISSING_ARGS, _(u'Missing domain name and storage value.'), + ctx.scmd) + if ctx.argc < 4: + usage(EX_MISSING_ARGS, _(u'Missing storage value.'), ctx.scmd) + messages = 0 + force = None + try: + bytes_ = size_in_bytes(ctx.args[3]) + except (ValueError, TypeError): + usage(INVALID_ARGUMENT, _(u"Invalid storage value: '%s'") % + ctx.args[3], ctx.scmd) + if ctx.argc < 5: + pass + elif ctx.argc < 6: + try: + messages = int(ctx.args[4]) + except ValueError: + if ctx.args[4].lower() != 'force': + usage(INVALID_ARGUMENT, + _(u"Neither a valid number of messages nor the keyword " + u"'force': '%s'") % ctx.args[4], ctx.scmd) + force = 'force' + else: + try: + messages = int(ctx.args[4]) + except ValueError: + usage(INVALID_ARGUMENT, + _(u"Not a valid number of messages: '%s'") % ctx.args[4], + ctx.scmd) + if ctx.args[5].lower() != 'force': + usage(INVALID_ARGUMENT, _(u"Invalid argument: '%s'") % ctx.args[5], + ctx.scmd) + force = 'force' + ctx.hdlr.domain_quotalimit(ctx.args[2].lower(), bytes_, messages, force) + + def domain_transport(ctx): """update the transport of the specified domain""" if ctx.argc < 3: @@ -304,7 +344,7 @@ def help_(ctx): - """print help messgaes.""" + """print help messages.""" if ctx.argc > 2: hlptpc = ctx.args[2].lower() if hlptpc in cmd_map: @@ -506,6 +546,30 @@ ctx.hdlr.user_password(ctx.args[2].lower(), password) +def user_quota(ctx): + """update the quota limit for the given address""" + if ctx.argc < 3: + usage(EX_MISSING_ARGS, _(u'Missing e-mail address and storage value.'), + ctx.scmd) + elif ctx.argc < 4: + usage(EX_MISSING_ARGS, _(u'Missing storage value.'), ctx.scmd) + try: + bytes_ = size_in_bytes(ctx.args[3]) + except (ValueError, TypeError): + usage(INVALID_ARGUMENT, _(u"Invalid storage value: '%s'") % + ctx.args[3], ctx.scmd) + if ctx.argc < 5: + messages = 0 + else: + try: + messages = int(ctx.args[4]) + except ValueError: + usage(INVALID_ARGUMENT, + _(u"Not a valid number of messages: '%s'") % ctx.args[4], + ctx.scmd) + ctx.hdlr.user_quotalimit(ctx.args[2].lower(), bytes_, messages) + + def user_transport(ctx): """update the transport of the given address""" if ctx.argc < 3: @@ -579,6 +643,9 @@ 'userpassword': cmd('userpassword', 'up', user_password, 'address [password]', _(u'update the password for the given address')), + 'userquota': cmd('userquota', 'uq', user_quota, + 'address storage [messages]', + _(u'update the quota limit for the given address')), 'usertransport': cmd('usertransport', 'ut', user_transport, 'address transport', _(u'update the transport of the given address')), @@ -609,6 +676,9 @@ _(u'delete the given domain and all its alias domains')), 'domaininfo': cmd('domaininfo', 'di', domain_info, 'fqdn [details]', _(u'display information about the given domain')), + 'domainquota': cmd('domainquota', 'dq', domain_quota, + 'fqdn storage [messages] [force]', + _(u'update the quota limit of the specified domain')), 'domaintransport': cmd('domaintransport', 'dt', domain_transport, 'fqdn transport [force]', _(u'update the transport of the specified domain')), |
|
From: <nev...@us...> - 2011-02-13 03:32:46
|
details: http://hg.localdomain.org/vmm/rev/8984b1f4e6e3 changeset: 402:8984b1f4e6e3 user: Pascal Volk date: Sun Feb 13 03:32:31 2011 +0000 description: VMM/domain: Execute the database updates of Domain.update_{quotalimit,transport}() when argument force is True, even when the 'new' setting is the same as the current one. diffstat: VirtualMailManager/domain.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r 00a8c12a3da3 -r 8984b1f4e6e3 VirtualMailManager/domain.py --- a/VirtualMailManager/domain.py Sat Feb 12 20:40:44 2011 +0000 +++ b/VirtualMailManager/domain.py Sun Feb 13 03:32:31 2011 +0000 @@ -268,7 +268,7 @@ """ self._chk_state() assert isinstance(quotalimit, QuotaLimit) - if quotalimit == self._qlimit: + if not force and quotalimit == self._qlimit: return self._update_tables('qid', quotalimit.qid, force) self._qlimit = quotalimit @@ -289,7 +289,7 @@ """ self._chk_state() assert isinstance(transport, Transport) - if transport == self._transport: + if not force and transport == self._transport: return self._update_tables('tid', transport.tid, force) self._transport = transport |
|
From: <nev...@us...> - 2011-02-12 20:40:56
|
details: http://hg.localdomain.org/vmm/rev/00a8c12a3da3 changeset: 401:00a8c12a3da3 user: Pascal Volk date: Sat Feb 12 20:40:44 2011 +0000 description: VMM/cli/subcommands: Divided 'quota usage' from userinfo subcommand into 'quota storage' and 'quota messages'. diffstat: VirtualMailManager/cli/subcommands.py | 58 ++++++++++++++++------------------ 1 files changed, 28 insertions(+), 30 deletions(-) diffs (88 lines): diff -r 0512d940918f -r 00a8c12a3da3 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Sat Feb 12 18:12:37 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sat Feb 12 20:40:44 2011 +0000 @@ -471,13 +471,16 @@ raise else: if details in (None, 'du'): - info['quota usage'] = _format_quota_usage(info['ql_bytes'], - info['ql_messages'], info['uq_bytes'], info['uq_messages']) + info['quota storage'] = _format_quota_usage(info['ql_bytes'], + info['uq_bytes'], True) + info['quota messages'] = _format_quota_usage(info['ql_messages'], + info['uq_messages']) _print_info(ctx, info, _(u'Account')) else: - info[0]['quota usage'] = _format_quota_usage(info[0]['ql_bytes'], - info[0]['ql_messages'], info[0]['uq_bytes'], - info[0]['uq_messages']) + info[0]['quota storage'] = _format_quota_usage(info[0]['ql_bytes'], + info['uq_bytes'], True) + info[0]['quota messages'] = _format_quota_usage( + info[0]['ql_messages'], info[0]['uq_messages']) _print_info(ctx, info[0], _(u'Account')) _print_list(info[1], _(u'alias addresses')) @@ -649,12 +652,13 @@ ctx.cget('account.disk_usage'): order = ((u'address', 0), (u'name', 0), (u'uid', 1), (u'gid', 1), (u'home', 0), (u'mail_location', 0), - (u'quota usage', 0), (u'disk usage', 0), - (u'transport', 0), (u'smtp', 1), (u'pop3', 1), - (u'imap', 1), (sieve, 1)) + (u'quota storage', 0), (u'quota messages', 0), + (u'disk usage', 0), (u'transport', 0), (u'smtp', 1), + (u'pop3', 1), (u'imap', 1), (sieve, 1)) else: order = ((u'address', 0), (u'name', 0), (u'uid', 1), (u'gid', 1), - (u'home', 0), (u'mail_location', 0), (u'quota usage', 0), + (u'home', 0), (u'mail_location', 0), + (u'quota storage', 0), (u'quota messages', 0), (u'transport', 0), (u'smtp', 1), (u'pop3', 1), (u'imap', 1), (sieve, 1)) elif ctx.scmd == 'getuser': @@ -662,29 +666,23 @@ return order -def _format_quota_usage(ql_bytes, ql_messages, qu_bytes, qu_messages): - """Put quota limits / usage / percentage in a formatted string.""" - q_usage = { - 'bytes_used': human_size(qu_bytes), - 'bytes_limit': human_size(ql_bytes), - 'msgs_used': qu_messages, - 'msgs_limit': ql_messages, - } - if ql_bytes: - q_usage['bytes_percent'] = 100. / ql_bytes * qu_bytes +def _format_quota_usage(limit, used, human=False): + """Put quota's limit / usage / percentage in a formatted string.""" + if human: + q_usage = { + 'used': human_size(used), + 'limit': human_size(limit), + } else: - q_usage['bytes_percent'] = 0. - if ql_messages: - q_usage['msgs_percent'] = 100. / ql_messages * qu_messages + q_usage = { + 'used': used, + 'limit': limit, + } + if limit: + q_usage['percent'] = 100. / limit * used else: - q_usage['msgs_percent'] = 0. - - # TP: example of quota usage message: - # XXX file in XXX - txt = _(u'Storage: %(bytes_used)s/%(bytes_limit)s (%(bytes_percent).2f%%) ' - 'Messages: %(msgs_used)u/%(msgs_limit)u (%(msgs_percent).2f%%)') \ - % q_usage - return txt + q_usage['percent'] = 0. + return _(u'[%(percent)6.2f%%] %(used)s/%(limit)s') % q_usage def _print_info(ctx, info, title): |
|
From: <nev...@us...> - 2011-02-12 18:12:52
|
details: http://hg.localdomain.org/vmm/rev/0512d940918f changeset: 400:0512d940918f user: Pascal Volk date: Sat Feb 12 18:12:37 2011 +0000 description: VMM/quotalimit: Don't fail in QuotaLimit.__init__, if we get the deafult misc.quota_bytes value: '0'. diffstat: VirtualMailManager/quotalimit.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diffs (12 lines): diff -r fb22773f7a85 -r 0512d940918f VirtualMailManager/quotalimit.py --- a/VirtualMailManager/quotalimit.py Sat Feb 12 17:19:43 2011 +0000 +++ b/VirtualMailManager/quotalimit.py Sat Feb 12 18:12:37 2011 +0000 @@ -55,6 +55,8 @@ self._load_by_qid(qid) else: bytes_, msgs = kwargs.get('bytes'), kwargs.get('messages') + if bytes_ == '0': # default from Config + bytes_ = 0 assert all(isinstance(i, (int, long)) for i in (bytes_, msgs)) if bytes_ < 0: self._bytes = -bytes_ |
|
From: <nev...@us...> - 2011-02-12 17:19:55
|
details: http://hg.localdomain.org/vmm/rev/fb22773f7a85 changeset: 399:fb22773f7a85 user: Pascal Volk date: Sat Feb 12 17:19:43 2011 +0000 description: VMM/common: Reworked human_size() once more. Return bytes w/o prefix. Use translatable $FOO_bibyte prefixes, e.g., MiB. diffstat: VirtualMailManager/common.py | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diffs (30 lines): diff -r 3e5ed678d535 -r fb22773f7a85 VirtualMailManager/common.py --- a/VirtualMailManager/common.py Sat Feb 12 01:46:00 2011 +0000 +++ b/VirtualMailManager/common.py Sat Feb 12 17:19:43 2011 +0000 @@ -76,16 +76,16 @@ raise TypeError("'size' must be a positive long or int.") if size < 0: raise ValueError("'size' must be a positive long or int.") - if not size: - return '0b' - unit_limit = (('T', 1 << 40), ('G', 1 << 30), ('M', 1 << 20), - ('k', 1 << 10), ('b', 1)) - for unit, limit in unit_limit: - if size >= limit: - if unit != 'b': - return '%.2f%s' % (size / float(limit), unit) - else: - return '%ub' % size + if size < 1024: + return str(size) + prefix_multiply = ((_(u'TiB'), 1 << 40), (_(u'GiB'), 1 << 30), + (_(u'MiB'), 1 << 20), (_(u'KiB'), 1 << 10)) + for prefix, multiply in prefix_multiply: + if size >= multiply: + # TP: e.g.: '%(size).2f %(prefix)s' -> '118.30 MiB' + return _(u'%(size).2f %(prefix)s') % { + 'size': float(size) / multiply, + 'prefix': prefix} def size_in_bytes(size): |
|
From: <nev...@us...> - 2011-02-12 01:46:13
|
details: http://hg.localdomain.org/vmm/rev/3e5ed678d535 changeset: 398:3e5ed678d535 user: Pascal Volk date: Sat Feb 12 01:46:00 2011 +0000 description: VMM/cli/subcommands: Added quota limit/usage output to {domain,user}info subcommands. diffstat: VirtualMailManager/cli/subcommands.py | 46 +++++++++++++++++++++++++++++++--- 1 files changed, 41 insertions(+), 5 deletions(-) diffs (89 lines): diff -r cf661a40266d -r 3e5ed678d535 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Fri Feb 11 19:16:37 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sat Feb 12 01:46:00 2011 +0000 @@ -257,8 +257,12 @@ raise else: if not details: + info['quota limit'] = _(u'Storage: %s Messages %u') % ( + human_size(info['bytes']), info['messages']) _print_info(ctx, info, _(u'Domain')) else: + info[0]['quota limit'] = _(u'Storage: %s Messages %u') % ( + human_size(info[0]['bytes']), info[0]['messages']) _print_info(ctx, info[0], _(u'Domain')) if details == u'accounts': _print_list(info[1], _(u'accounts')) @@ -467,8 +471,13 @@ raise else: if details in (None, 'du'): + info['quota usage'] = _format_quota_usage(info['ql_bytes'], + info['ql_messages'], info['uq_bytes'], info['uq_messages']) _print_info(ctx, info, _(u'Account')) else: + info[0]['quota usage'] = _format_quota_usage(info[0]['ql_bytes'], + info[0]['ql_messages'], info[0]['uq_bytes'], + info[0]['uq_messages']) _print_info(ctx, info[0], _(u'Account')) _print_list(info[1], _(u'alias addresses')) @@ -631,26 +640,53 @@ order = () if ctx.scmd == 'domaininfo': order = ((u'domainname', 0), (u'gid', 1), (u'transport', 0), - (u'domaindir', 0), (u'aliasdomains', 0), (u'accounts', 0), - (u'aliases', 0), (u'relocated', 0)) + (u'domaindir', 0), (u'quota limit', 0), (u'aliasdomains', 0), + (u'accounts', 0), (u'aliases', 0), (u'relocated', 0)) elif ctx.scmd == 'userinfo': dc12 = ctx.cget('misc.dovecot_version') >= 0x10200b02 sieve = (u'managesieve', u'sieve')[dc12] if ctx.argc == 4 and ctx.args[3] != u'aliases' or \ ctx.cget('account.disk_usage'): order = ((u'address', 0), (u'name', 0), (u'uid', 1), (u'gid', 1), - (u'home', 0), (u'mail_location', 0), (u'disk usage', 0), + (u'home', 0), (u'mail_location', 0), + (u'quota usage', 0), (u'disk usage', 0), (u'transport', 0), (u'smtp', 1), (u'pop3', 1), (u'imap', 1), (sieve, 1)) else: order = ((u'address', 0), (u'name', 0), (u'uid', 1), (u'gid', 1), - (u'home', 0), (u'mail_location', 0), (u'transport', 0), - (u'smtp', 1), (u'pop3', 1), (u'imap', 1), (sieve, 1)) + (u'home', 0), (u'mail_location', 0), (u'quota usage', 0), + (u'transport', 0), (u'smtp', 1), (u'pop3', 1), + (u'imap', 1), (sieve, 1)) elif ctx.scmd == 'getuser': order = ((u'uid', 1), (u'gid', 1), (u'address', 0)) return order +def _format_quota_usage(ql_bytes, ql_messages, qu_bytes, qu_messages): + """Put quota limits / usage / percentage in a formatted string.""" + q_usage = { + 'bytes_used': human_size(qu_bytes), + 'bytes_limit': human_size(ql_bytes), + 'msgs_used': qu_messages, + 'msgs_limit': ql_messages, + } + if ql_bytes: + q_usage['bytes_percent'] = 100. / ql_bytes * qu_bytes + else: + q_usage['bytes_percent'] = 0. + if ql_messages: + q_usage['msgs_percent'] = 100. / ql_messages * qu_messages + else: + q_usage['msgs_percent'] = 0. + + # TP: example of quota usage message: + # XXX file in XXX + txt = _(u'Storage: %(bytes_used)s/%(bytes_limit)s (%(bytes_percent).2f%%) ' + 'Messages: %(msgs_used)u/%(msgs_limit)u (%(msgs_percent).2f%%)') \ + % q_usage + return txt + + def _print_info(ctx, info, title): """Print info dicts.""" # TP: used in e.g. 'Domain information' or 'Account information' |
|
From: <nev...@us...> - 2011-02-11 19:16:48
|
details: http://hg.localdomain.org/vmm/rev/cf661a40266d changeset: 397:cf661a40266d user: Pascal Volk date: Fri Feb 11 19:16:37 2011 +0000 description: VMM/cli/subcommands: config_get: Print configured misc.quota_bytes in human readable format. diffstat: VirtualMailManager/cli/subcommands.py | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diffs (33 lines): diff -r 7f931c1ca059 -r cf661a40266d VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Fri Feb 11 18:22:37 2011 +0000 +++ b/VirtualMailManager/cli/subcommands.py Fri Feb 11 19:16:37 2011 +0000 @@ -17,7 +17,7 @@ from VirtualMailManager import ENCODING from VirtualMailManager.account import SERVICES from VirtualMailManager.cli import get_winsize, prog, w_err, w_std -from VirtualMailManager.common import version_str +from VirtualMailManager.common import human_size, version_str from VirtualMailManager.constants import __copyright__, __date__, \ __version__, ACCOUNT_EXISTS, ALIAS_EXISTS, ALIASDOMAIN_ISDOMAIN, \ DOMAIN_ALIAS_EXISTS, INVALID_ARGUMENT, EX_MISSING_ARGS, RELOCATED_EXISTS @@ -174,11 +174,16 @@ """show the actual value of the configuration option""" if ctx.argc < 3: usage(EX_MISSING_ARGS, _(u"Missing option name."), ctx.scmd) + + noop = lambda option: option + opt_formater = { + 'misc.dovecot_version': version_str, + 'misc.quota_bytes': human_size, + } + option = ctx.args[2].lower() - if option != 'misc.dovecot_version': - w_std('%s = %s' % (option, ctx.cget(option))) - else: - w_std('%s = %s' % (option, version_str(ctx.cget(option)))) + w_std('%s = %s' % (option, opt_formater.get(option, + noop)(ctx.cget(option)))) def config_set(ctx): |
|
From: <nev...@us...> - 2011-02-11 18:22:51
|
details: http://hg.localdomain.org/vmm/rev/7f931c1ca059 changeset: 396:7f931c1ca059 user: Pascal Volk date: Fri Feb 11 18:22:37 2011 +0000 description: VMM/common: human_size() size argument can be also a string. Because the default value of misc.quota_bytes is '0', a string in order to accept also settings like '500M'. diffstat: VirtualMailManager/common.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diffs (19 lines): diff -r 0a13849243f2 -r 7f931c1ca059 VirtualMailManager/common.py --- a/VirtualMailManager/common.py Fri Feb 11 11:52:59 2011 +0000 +++ b/VirtualMailManager/common.py Fri Feb 11 18:22:37 2011 +0000 @@ -69,8 +69,13 @@ def human_size(size): """Converts the `size` in bytes in human readable format.""" - if not isinstance(size, (long, int)) or size < 0: - raise TypeError("'size' must be a positive long or int.") + if not isinstance(size, (long, int)): + try: + size = long(size) + except ValueError: + raise TypeError("'size' must be a positive long or int.") + if size < 0: + raise ValueError("'size' must be a positive long or int.") if not size: return '0b' unit_limit = (('T', 1 << 40), ('G', 1 << 30), ('M', 1 << 20), |