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
(6) |
|
2
(2) |
3
(1) |
4
|
5
|
6
|
7
|
8
(2) |
|
9
(1) |
10
(2) |
11
(2) |
12
(4) |
13
|
14
|
15
(6) |
|
16
(1) |
17
(3) |
18
|
19
|
20
|
21
|
22
|
|
23
(4) |
24
|
25
|
26
|
27
|
28
|
|
|
From: <nev...@us...> - 2014-02-23 23:39:06
|
details: http://hg.localdomain.org/vmm/rev/935b4901d652 changeset: 738:935b4901d652 user: Pascal Volk date: Sun Feb 23 23:38:12 2014 +0000 description: {man1,doc/web}: Added description of userpassword's --hash option. diffstat: doc/web/source/howto/manage_accounts.rst | 21 ++++++++++++++++++--- man/man1/vmm.1 | 29 ++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diffs (105 lines): diff -r 81f4bfc34ed8 -r 935b4901d652 doc/web/source/howto/manage_accounts.rst --- a/doc/web/source/howto/manage_accounts.rst Sun Feb 23 18:16:57 2014 +0000 +++ b/doc/web/source/howto/manage_accounts.rst Sun Feb 23 23:38:12 2014 +0000 @@ -151,8 +151,10 @@ .. program:: vmm userpassword Syntax: - | **vmm userpassword** *address* [**-p** *password*] [**-s** *scheme*] - | **vmm up** *address* [**-p** *password*] [**-s** *scheme*] + | **vmm userpassword** *address* ([**-p** *password*] [**-s** *scheme*] | \ + [**‒‒hash** *pwhash*]) + | **vmm up** *address* ([**-p** *password*] [**-s** *scheme*] | \ + [**‒‒hash** *pwhash*]) .. option:: -p password @@ -163,9 +165,22 @@ When a *scheme* was specified, it overrides the *misc.password_scheme* setting, configured in the :file:`vmm.cfg` file. +.. option:: --hash pwhash + + A hashed password, prefixed with **{**\ *SCHEME*\ **}**; as generated by + :command:`doveadm pw`. + You should enclose the hashed password in single quotes, if it contains + one ore more dollar signs (**$**). + The password of an account can be updated with this subcommand. -If no *password* was provided, :command:`vmm` will prompt for it interactively. +If no *password* or *pwhash* was provided, :command:`vmm` will prompt for a +password interactively. + +.. note:: + When passing a hashed password, :command:`vmm` checks only if the included + *SCHEME* is supported by your Dovecot installation. No further checks are + done. Example: diff -r 81f4bfc34ed8 -r 935b4901d652 man/man1/vmm.1 --- a/man/man1/vmm.1 Sun Feb 23 18:16:57 2014 +0000 +++ b/man/man1/vmm.1 Sun Feb 23 23:38:12 2014 +0000 @@ -1,4 +1,4 @@ -.TH "VMM" "1" "2014-02-15" "vmm 0.7" "vmm" +.TH "VMM" "1" "2014-02-23" "vmm 0.7" "vmm" .SH NAME vmm \- command line tool to manage email domains/accounts/aliases .\" ----------------------------------------------------------------------- @@ -836,10 +836,12 @@ .\" ------------------------------------ .SS userpassword (up) .BI "vmm userpassword" " address" -.RB [ \-p +.RB ([ \-p .IR password ] .RB [ \-s -.IR scheme ] +.IR scheme "] |" +.B \-\-hash +.IR pwhash ]) .PP .TP .BI "\-p " password @@ -855,14 +857,30 @@ .I vmm.cfg file. .\" ------------------------------------ +.TP +.BI "\-\-hash " pwhash +A hashed password, prefixed with +.BI { SCHEME }; +as generated by +.BR "doveadm pw" . +You should enclose the hashed password in single quotes, if it contains +one ore more dollar signs +.RB ( $ ). +.\" ------------------------------------ .PP The password of an account can be updated with this subcommand. .PP If no -.I password +.IR password " or " pwhash was provided, .B vmm -will prompt for it interactively. +will prompt for a password interactively. +.IP Note: +When passing a hashed password, +.B vmm +checks only if the included +.I SCHEME +is supported by your Dovecot installation. No further checks are done. .PP Example: .PP @@ -1140,6 +1158,7 @@ will be used when none of the both above mentioned files exists. .\" ----------------------------------------------------------------------- .SH SEE ALSO +.BR doveadm\-pw (1), .BR dsync (1), .BR transport (5), .BR vmm.cfg (5) |
|
From: <nev...@us...> - 2014-02-23 18:19:38
|
details: http://hg.localdomain.org/vmm/rev/81f4bfc34ed8 changeset: 737:81f4bfc34ed8 user: Pascal Volk date: Sun Feb 23 18:16:57 2014 +0000 description: VMM/cli/subcommands: userpassword: Added option --hash. vmm userpassword --hash {SCHEME}$HASH can be used to save a password hash, e.g. generated by doveadm pw, as new user password. diffstat: VirtualMailManager/cli/subcommands.py | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diffs (46 lines): diff -r 66a5f9a405da -r 81f4bfc34ed8 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Sun Feb 23 18:05:53 2014 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sun Feb 23 18:16:57 2014 +0000 @@ -396,8 +396,13 @@ def user_password(ctx): """update the password for the given address""" - ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password, - ctx.args.scheme) + if ctx.args.pwhash: + if ctx.args.scheme: + w_std(_('Info: The -s option is ignored when --hash was given.')) + ctx.hdlr.user_pwhash(ctx.args.address.lower(), ctx.args.pwhash) + else: + ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password, + ctx.args.scheme) def user_note(ctx): @@ -832,16 +837,21 @@ up = a('userpassword', aliases=('up',), help=_('update the password for the given address'), epilog=fill(_("The password of an account can be updated with this " - "subcommand.\n\nIf no password was provided, vmm will prompt " - "for it interactively. When the scheme was omitted, vmm will " - "use misc.password_scheme from vmm.cfg. ")), + "subcommand.\n\nIf neither a password nor a password hash was " + "provided, vmm will prompt for the new password interactively. " + "When the scheme was omitted, vmm will use " + "misc.password_scheme from vmm.cfg. ")), formatter_class=RawDescriptionHelpFormatter) up.add_argument('address', help=_("an account's e-mail address (local-part@fqdn)")) - up.add_argument('-p', metavar='PASSWORD', dest='password', - help=_("the user's new password")) + up_grp = up.add_mutually_exclusive_group() + up_grp.add_argument('-p', metavar='PASSWORD', dest='password', + help=_("the user's new password")) up.add_argument('-s', metavar='SCHEME', dest='scheme', help=_('scheme used for password hashing')) + up_grp.add_argument('--hash', metavar='PWHASH', dest='pwhash', + help=_('set the given password hash as-is as new ' + 'password')) up.set_defaults(func=user_password, scmd='userpassword') uq = a('userquota', aliases=('uq',), |
|
From: <nev...@us...> - 2014-02-23 18:19:20
|
details: http://hg.localdomain.org/vmm/rev/66a5f9a405da changeset: 736:66a5f9a405da user: Pascal Volk date: Sun Feb 23 18:05:53 2014 +0000 description: VMM/handler: Added method Handler.user_pwhash. diffstat: VirtualMailManager/handler.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diffs (32 lines): diff -r ddcad86f7386 -r 66a5f9a405da VirtualMailManager/handler.py --- a/VirtualMailManager/handler.py Sun Feb 23 18:00:35 2014 +0000 +++ b/VirtualMailManager/handler.py Sun Feb 23 18:05:53 2014 +0000 @@ -40,6 +40,7 @@ from VirtualMailManager.errors import \ DomainError, NotRootError, PermissionError, VMMError from VirtualMailManager.mailbox import new as new_mailbox +from VirtualMailManager.password import extract_scheme, verify_scheme from VirtualMailManager.quotalimit import QuotaLimit from VirtualMailManager.relocated import Relocated from VirtualMailManager.serviceset import ServiceSet, SERVICES @@ -765,6 +766,20 @@ acc.address, NO_SUCH_ACCOUNT) acc.update_password(password, scheme) + def user_pwhash(self, emailaddress, pwhash): + """Wrapper for Account.modify('pwhash', ...)""" + scheme = extract_scheme(pwhash) + if not scheme: + raise VMMError(_('Missing {SCHEME} prefix from password hash.'), + INVALID_ARGUMENT) + else: + scheme, encoding = verify_scheme(scheme) # or die … + acc = self._get_account(emailaddress) + if not acc: + raise VMMError(_("The account '%s' does not exist.") % + acc.address, NO_SUCH_ACCOUNT) + acc.modify('pwhash', pwhash) + def user_name(self, emailaddress, name): """Wrapper for Account.modify('name', ...).""" acc = self._get_account(emailaddress) |
|
From: <nev...@us...> - 2014-02-23 18:18:49
|
details: http://hg.localdomain.org/vmm/rev/ddcad86f7386 changeset: 735:ddcad86f7386 user: Pascal Volk date: Sun Feb 23 18:00:35 2014 +0000 description: VMM/account: Account.modify accepts a password hash. diffstat: VirtualMailManager/account.py | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diffs (26 lines): diff -r 8167ba72235c -r ddcad86f7386 VirtualMailManager/account.py --- a/VirtualMailManager/account.py Mon Feb 17 23:19:01 2014 +0000 +++ b/VirtualMailManager/account.py Sun Feb 23 18:00:35 2014 +0000 @@ -261,17 +261,19 @@ def modify(self, field, value): """Update the Account's *field* to the new *value*. - Possible values for *field* are: 'name' and 'note'. + Possible values for *field* are: 'name', 'note' and 'pwhash'. Arguments: `field` : str - The attribute name: 'name', or 'note' + The attribute name: 'name', 'note' or 'pwhash' `value` : str The new value of the attribute. """ - if field not in ('name', 'note'): + if field not in ('name', 'note', 'pwhash'): raise AErr(_("Unknown field: '%s'") % field, INVALID_ARGUMENT) + if field == 'pwhash': + field = 'passwd' self._chk_state() dbc = self._dbh.cursor() dbc.execute('UPDATE users SET %s = %%s WHERE uid = %%s' % field, |
|
From: <nev...@us...> - 2014-02-17 23:19:52
|
details: http://hg.localdomain.org/vmm/rev/8167ba72235c changeset: 734:8167ba72235c user: Pascal Volk date: Mon Feb 17 23:19:01 2014 +0000 description: merged changes from default(8c7eeb2bc139). diffstat: Configure.Dovecot_2 | 3 +++ man/man5/vmm.cfg.5 | 11 ++++++++++- vmm.cfg | 3 +++ 3 files changed, 16 insertions(+), 1 deletions(-) diffs (51 lines): diff -r 77561c118f42 -r 8167ba72235c Configure.Dovecot_2 --- a/Configure.Dovecot_2 Sun Feb 16 23:07:30 2014 +0000 +++ b/Configure.Dovecot_2 Mon Feb 17 23:19:01 2014 +0000 @@ -25,6 +25,9 @@ ### # conf.d/10-auth.conf ### +# When you set another misc.password_scheme than PLAIN or CRAM-MD5 in +# your vmm.cfg, you have to remove cram-md5 from the auth_mechanisms +# setting. auth_mechanisms = plain login cram-md5 passdb { driver = sql diff -r 77561c118f42 -r 8167ba72235c man/man5/vmm.cfg.5 --- a/man/man5/vmm.cfg.5 Sun Feb 16 23:07:30 2014 +0000 +++ b/man/man5/vmm.cfg.5 Mon Feb 17 23:19:01 2014 +0000 @@ -1,4 +1,4 @@ -.TH "VMM.CFG" "5" "2014-02-11" "vmm 0.7" "vmm" +.TH "VMM.CFG" "5" "2014-02-17" "vmm 0.7" "vmm" .SH NAME vmm.cfg \- configuration file for vmm .\" ----------------------------------------------------------------------- @@ -509,6 +509,15 @@ Supported encoding suffixes are: .BR .b64 ", " .base64 " and " .hex . For example: PLAIN.BASE64 +.IP Note: +When setting another password scheme than +.BR PLAIN " or " CRAM\-MD5 , +you have to remove +.B cram\-md5 +from the +.I auth_mechanisms +setting in your +.IR dovecot/conf.d/10\-auth.conf . .\" ----------------------------------------------------------------------- .SH EXAMPLE An example configuration. diff -r 77561c118f42 -r 8167ba72235c vmm.cfg --- a/vmm.cfg Sun Feb 16 23:07:30 2014 +0000 +++ b/vmm.cfg Mon Feb 17 23:19:01 2014 +0000 @@ -148,6 +148,9 @@ ; the version number from `dovecot --version` (String) ; e.g. 1.2.17, 2.0.21, 2.1.9 or 2.2.beta1 dovecot_version = 2.1.9 +; NOTE: When using other password schemes than PLAIN or CRAM-MD5, you +; have to remove `cram-md5' from the auth_mechanisms setting in +; dovecot/conf.d/10-auth.conf. ; Password scheme to use (see also: ´vmm listpwschemes`) (String) password_scheme = CRAM-MD5 |
|
From: <nev...@us...> - 2014-02-17 22:30:07
|
details: http://hg.localdomain.org/vmm/rev/8c7eeb2bc139 changeset: 733:8c7eeb2bc139 user: Pascal Volk date: Mon Feb 17 22:28:22 2014 +0000 description: VMM/config: Corrected a setting name in an error msg. diffstat: VirtualMailManager/config.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r fae6a42add07 -r 8c7eeb2bc139 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Mon Feb 17 20:30:31 2014 +0000 +++ b/VirtualMailManager/config.py Mon Feb 17 22:28:22 2014 +0000 @@ -435,7 +435,7 @@ if not miss_vers: value = self.get('misc', 'dovecot_version') if not VERSION_RE.match(value): - self._missing['misc'] = ['version: ' + + self._missing['misc'] = ['dovecot_version: ' + _(u"Not a valid Dovecot version: '%s'") % value] # section database db_err = [] |
|
From: <nev...@us...> - 2014-02-17 20:32:14
|
details: http://hg.localdomain.org/vmm/rev/fae6a42add07 changeset: 732:fae6a42add07 user: Pascal Volk date: Mon Feb 17 20:30:31 2014 +0000 description: Added a note about the usage of CRAM-MD5. diffstat: Configure.Dovecot_2 | 3 +++ doc/web/source/_static/vmm.cfg | 3 +++ man/man5/vmm.cfg.5 | 11 ++++++++++- vmm.cfg | 3 +++ 4 files changed, 19 insertions(+), 1 deletions(-) diffs (64 lines): diff -r 5716bf441ceb -r fae6a42add07 Configure.Dovecot_2 --- a/Configure.Dovecot_2 Sat Feb 01 20:32:32 2014 +0000 +++ b/Configure.Dovecot_2 Mon Feb 17 20:30:31 2014 +0000 @@ -25,6 +25,9 @@ ### # conf.d/10-auth.conf ### +# When you set another misc.password_scheme than PLAIN or CRAM-MD5 in +# your vmm.cfg, you have to remove cram-md5 from the auth_mechanisms +# setting. auth_mechanisms = plain login cram-md5 passdb { driver = sql diff -r 5716bf441ceb -r fae6a42add07 doc/web/source/_static/vmm.cfg --- a/doc/web/source/_static/vmm.cfg Sat Feb 01 20:32:32 2014 +0000 +++ b/doc/web/source/_static/vmm.cfg Mon Feb 17 20:30:31 2014 +0000 @@ -154,6 +154,9 @@ ; the version number from `dovecot --version` (String) ; e.g. 1.2.17, 2.0.21, 2.1.9 or 2.2.beta1 dovecot_version = 2.1.9 +; NOTE: When using other password schemes than PLAIN or CRAM-MD5, you +; have to remove `cram-md5' from the auth_mechanisms setting in +; dovecot/conf.d/10-auth.conf. ; Password scheme to use (see also: ´vmm listpwschemes`) (String) password_scheme = CRAM-MD5 diff -r 5716bf441ceb -r fae6a42add07 man/man5/vmm.cfg.5 --- a/man/man5/vmm.cfg.5 Sat Feb 01 20:32:32 2014 +0000 +++ b/man/man5/vmm.cfg.5 Mon Feb 17 20:30:31 2014 +0000 @@ -1,4 +1,4 @@ -.TH "VMM.CFG" "5" "2012-08-12" "vmm 0.6" "vmm" +.TH "VMM.CFG" "5" "2014-02-17" "vmm 0.6" "vmm" .SH NAME vmm.cfg \- configuration file for vmm .\" ----------------------------------------------------------------------- @@ -533,6 +533,15 @@ Supported encoding suffixes are: .BR .b64 ", " .base64 " and " .hex . For example: PLAIN.BASE64 +.IP Note: +When setting another password scheme than +.BR PLAIN " or " CRAM\-MD5 , +you have to remove +.B cram\-md5 +from the +.I auth_mechanisms +setting in your +.IR dovecot/conf.d/10\-auth.conf . .\" ----------------------------------------------------------------------- .SH EXAMPLE An example configuration. diff -r 5716bf441ceb -r fae6a42add07 vmm.cfg --- a/vmm.cfg Sat Feb 01 20:32:32 2014 +0000 +++ b/vmm.cfg Mon Feb 17 20:30:31 2014 +0000 @@ -154,6 +154,9 @@ ; the version number from `dovecot --version` (String) ; e.g. 1.2.17, 2.0.21, 2.1.9 or 2.2.beta1 dovecot_version = 2.1.9 +; NOTE: When using other password schemes than PLAIN or CRAM-MD5, you +; have to remove `cram-md5' from the auth_mechanisms setting in +; dovecot/conf.d/10-auth.conf. ; Password scheme to use (see also: ´vmm listpwschemes`) (String) password_scheme = CRAM-MD5 |
|
From: <nev...@us...> - 2014-02-16 23:09:00
|
details: http://hg.localdomain.org/vmm/rev/77561c118f42 changeset: 731:77561c118f42 user: Pascal Volk date: Sun Feb 16 23:07:30 2014 +0000 description: VMM/password: Added function extract_scheme(). diffstat: VirtualMailManager/password.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diffs (33 lines): diff -r d3a246067e8f -r 77561c118f42 VirtualMailManager/password.py --- a/VirtualMailManager/password.py Sat Feb 15 23:38:27 2014 +0000 +++ b/VirtualMailManager/password.py Sun Feb 16 23:07:30 2014 +0000 @@ -13,9 +13,11 @@ random_password = randompw() scheme, encoding = verify_scheme(scheme) schemes, encodings = list_schemes() + scheme = extract_scheme(hashed_password) """ import hashlib +import re from base64 import b64encode from binascii import b2a_hex @@ -309,6 +311,17 @@ } +def extract_scheme(password_hash): + """Returns the extracted password scheme from *password_hash*. + + If the scheme couldn't be extracted, **None** will be returned. + """ + scheme = re.match(r'^\{([^\}]{3,37})\}', password_hash) + if scheme: + return scheme.groups()[0] + return scheme + + def list_schemes(): """Returns the tuple (schemes, encodings). |
|
From: <nev...@us...> - 2014-02-15 23:40:45
|
details: http://hg.localdomain.org/vmm/rev/d3a246067e8f changeset: 730:d3a246067e8f user: Pascal Volk date: Sat Feb 15 23:38:27 2014 +0000 description: {man1,doc/web}: Added description of userpassword's -s option. diffstat: doc/web/source/howto/manage_accounts.rst | 15 +++++++++++++-- man/man1/vmm.1 | 19 ++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diffs (59 lines): diff -r 26a6231b9c6a -r d3a246067e8f doc/web/source/howto/manage_accounts.rst --- a/doc/web/source/howto/manage_accounts.rst Sat Feb 15 21:48:40 2014 +0000 +++ b/doc/web/source/howto/manage_accounts.rst Sat Feb 15 23:38:27 2014 +0000 @@ -148,9 +148,20 @@ userpassword ------------ +.. program:: vmm userpassword + Syntax: - | **vmm userpassword** *address* [**-p** *password*] - | **vmm up** *address* [**-p** *password*] + | **vmm userpassword** *address* [**-p** *password*] [**-s** *scheme*] + | **vmm up** *address* [**-p** *password*] [**-s** *scheme*] + +.. option:: -p password + + The user's new password. + +.. option:: -s scheme + + When a *scheme* was specified, it overrides the *misc.password_scheme* + setting, configured in the :file:`vmm.cfg` file. The password of an account can be updated with this subcommand. diff -r 26a6231b9c6a -r d3a246067e8f man/man1/vmm.1 --- a/man/man1/vmm.1 Sat Feb 15 21:48:40 2014 +0000 +++ b/man/man1/vmm.1 Sat Feb 15 23:38:27 2014 +0000 @@ -1,4 +1,4 @@ -.TH "VMM" "1" "2013-01-23" "vmm 0.7" "vmm" +.TH "VMM" "1" "2014-02-15" "vmm 0.7" "vmm" .SH NAME vmm \- command line tool to manage email domains/accounts/aliases .\" ----------------------------------------------------------------------- @@ -838,6 +838,23 @@ .BI "vmm userpassword" " address" .RB [ \-p .IR password ] +.RB [ \-s +.IR scheme ] +.PP +.TP +.BI "\-p " password +The user\(aqs new password. +.\" ------------------------------------ +.TP +.BI "\-s " scheme +When a +.I scheme +was specified, it overrides the +.I misc.password_scheme +setting, configured in the +.I vmm.cfg +file. +.\" ------------------------------------ .PP The password of an account can be updated with this subcommand. .PP |
|
From: <nev...@us...> - 2014-02-15 21:50:08
|
details: http://hg.localdomain.org/vmm/rev/26a6231b9c6a changeset: 729:26a6231b9c6a user: Pascal Volk date: Sat Feb 15 21:48:40 2014 +0000 description: VMM/cli/handler: Improved CliHandler.user_password. When possible check the given password scheme before prompting for the password. diffstat: VirtualMailManager/cli/handler.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diffs (23 lines): diff -r 69eb7a65d8a4 -r 26a6231b9c6a VirtualMailManager/cli/handler.py --- a/VirtualMailManager/cli/handler.py Sat Feb 15 19:00:40 2014 +0000 +++ b/VirtualMailManager/cli/handler.py Sat Feb 15 21:48:40 2014 +0000 @@ -16,7 +16,7 @@ from VirtualMailManager.cli.config import CliConfig as Cfg from VirtualMailManager.constants import ACCOUNT_EXISTS, INVALID_SECTION, \ NO_SUCH_ACCOUNT, TYPE_ACCOUNT -from VirtualMailManager.password import randompw +from VirtualMailManager.password import randompw, verify_scheme _ = lambda msg: msg @@ -94,6 +94,10 @@ if not acc: raise VMMError(_("The account '%s' does not exist.") % acc.address, NO_SUCH_ACCOUNT) + if scheme: + scheme, encoding = verify_scheme(scheme) + if encoding: + scheme = '%s.%s' % (scheme, encoding) if not isinstance(password, str) or not password: password = read_pass() acc.update_password(password, scheme) |
|
From: <nev...@us...> - 2014-02-15 19:02:17
|
details: http://hg.localdomain.org/vmm/rev/69eb7a65d8a4 changeset: 728:69eb7a65d8a4 user: Pascal Volk date: Sat Feb 15 19:00:40 2014 +0000 description: VMM/cli/subcommands: userpassword added option -s. -s SCHEME can be used to (temporarily) override the password_scheme setting, configured in vmm.cfg. diffstat: VirtualMailManager/cli/subcommands.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diffs (30 lines): diff -r 695426b49de0 -r 69eb7a65d8a4 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Sat Feb 15 18:07:00 2014 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sat Feb 15 19:00:40 2014 +0000 @@ -396,7 +396,8 @@ def user_password(ctx): """update the password for the given address""" - ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password) + ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password, + ctx.args.scheme) def user_note(ctx): @@ -832,12 +833,15 @@ help=_('update the password for the given address'), epilog=fill(_("The password of an account can be updated with this " "subcommand.\n\nIf no password was provided, vmm will prompt " - "for it interactively.")), + "for it interactively. When the scheme was omitted, vmm will " + "use misc.password_scheme from vmm.cfg. ")), formatter_class=RawDescriptionHelpFormatter) up.add_argument('address', help=_("an account's e-mail address (local-part@fqdn)")) up.add_argument('-p', metavar='PASSWORD', dest='password', help=_("the user's new password")) + up.add_argument('-s', metavar='SCHEME', dest='scheme', + help=_('scheme used for password hashing')) up.set_defaults(func=user_password, scmd='userpassword') uq = a('userquota', aliases=('uq',), |
|
From: <nev...@us...> - 2014-02-15 18:08:06
|
details: http://hg.localdomain.org/vmm/rev/695426b49de0 changeset: 727:695426b49de0 user: Pascal Volk date: Sat Feb 15 18:07:00 2014 +0000 description: VMM/{cli,}/handler: Adjusted Handler.user_password. Use Account.update_password instead of Account.modify. diffstat: VirtualMailManager/cli/handler.py | 4 ++-- VirtualMailManager/handler.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diffs (43 lines): diff -r 46b37d7c848a -r 695426b49de0 VirtualMailManager/cli/handler.py --- a/VirtualMailManager/cli/handler.py Sat Feb 15 17:39:24 2014 +0000 +++ b/VirtualMailManager/cli/handler.py Sat Feb 15 18:07:00 2014 +0000 @@ -87,7 +87,7 @@ self._make_account_dirs(acc) return (None, password)[rand_pass] - def user_password(self, emailaddress, password=None): + def user_password(self, emailaddress, password=None, scheme=None): """Override the parent user_password() - add the interactive password dialog.""" acc = self._get_account(emailaddress) @@ -96,6 +96,6 @@ acc.address, NO_SUCH_ACCOUNT) if not isinstance(password, str) or not password: password = read_pass() - acc.modify('password', password) + acc.update_password(password, scheme) del _ diff -r 46b37d7c848a -r 695426b49de0 VirtualMailManager/handler.py --- a/VirtualMailManager/handler.py Sat Feb 15 17:39:24 2014 +0000 +++ b/VirtualMailManager/handler.py Sat Feb 15 18:07:00 2014 +0000 @@ -754,8 +754,8 @@ self._db_connect() return get_account_by_uid(uid, self._dbh) - def user_password(self, emailaddress, password): - """Wrapper for Account.modify('password' ...).""" + def user_password(self, emailaddress, password, scheme=None): + """Wrapper for Account.update_password(...).""" if not isinstance(password, str) or not password: raise VMMError(_("Could not accept password: '%s'") % password, INVALID_ARGUMENT) @@ -763,7 +763,7 @@ if not acc: raise VMMError(_("The account '%s' does not exist.") % acc.address, NO_SUCH_ACCOUNT) - acc.modify('password', password) + acc.update_password(password, scheme) def user_name(self, emailaddress, name): """Wrapper for Account.modify('name', ...).""" |
|
From: <nev...@us...> - 2014-02-15 17:40:50
|
details: http://hg.localdomain.org/vmm/rev/46b37d7c848a changeset: 726:46b37d7c848a user: Pascal Volk date: Sat Feb 15 17:39:24 2014 +0000 description: VMM/account: Added method Account.update_password. diffstat: VirtualMailManager/account.py | 40 +++++++++++++++++++++++++++++----------- 1 files changed, 29 insertions(+), 11 deletions(-) diffs (58 lines): diff -r 300b76de5ad0 -r 46b37d7c848a VirtualMailManager/account.py --- a/VirtualMailManager/account.py Sat Feb 15 16:46:45 2014 +0000 +++ b/VirtualMailManager/account.py Sat Feb 15 17:39:24 2014 +0000 @@ -261,25 +261,43 @@ def modify(self, field, value): """Update the Account's *field* to the new *value*. - Possible values for *field* are: 'name', 'password', 'note'. + Possible values for *field* are: 'name' and 'note'. Arguments: - `field` : basestring - The attribute name: 'name', 'password' or 'note' - `value` : basestring + `field` : str + The attribute name: 'name', or 'note' + `value` : str The new value of the attribute. """ - if field not in ('name', 'password', 'note'): + if field not in ('name', 'note'): raise AErr(_("Unknown field: '%s'") % field, INVALID_ARGUMENT) self._chk_state() dbc = self._dbh.cursor() - if field == 'password': - dbc.execute('UPDATE users SET passwd = %s WHERE uid = %s', - (pwhash(value, user=self._addr), self._uid)) - else: - dbc.execute('UPDATE users SET %s = %%s WHERE uid = %%s' % field, - (value, self._uid)) + dbc.execute('UPDATE users SET %s = %%s WHERE uid = %%s' % field, + (value, self._uid)) + if dbc.rowcount > 0: + self._dbh.commit() + dbc.close() + + def update_password(self, password, scheme=None): + """Update the Account's password. + + The given *password* will be hashed using password.pwhash. + When no *scheme* is specified, the configured scheme + (misc.password_scheme) will be used. + + Arguments: + + `password' : str + The Account's new plain text password + `scheme' : str + The password scheme used for password hashing; default None + """ + self._chk_state() + dbc = self._dbh.cursor() + dbc.execute('UPDATE users SET passwd = %s WHERE uid = %s', + (pwhash(password, scheme, self._addr), self.uid)) if dbc.rowcount > 0: self._dbh.commit() dbc.close() |
|
From: <nev...@us...> - 2014-02-15 16:48:52
|
details: http://hg.localdomain.org/vmm/rev/300b76de5ad0 changeset: 725:300b76de5ad0 user: Pascal Volk date: Sat Feb 15 16:46:45 2014 +0000 description: VMM/password: Dropped Dovecot v1 compatibility code. diffstat: VirtualMailManager/password.py | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diffs (28 lines): diff -r 348cd2cf9c18 -r 300b76de5ad0 VirtualMailManager/password.py --- a/VirtualMailManager/password.py Wed Feb 12 21:49:42 2014 +0000 +++ b/VirtualMailManager/password.py Sat Feb 15 16:46:45 2014 +0000 @@ -157,9 +157,6 @@ encrypted = b2a_hex(encrypted.encode()).decode() else: encrypted = b64encode(encrypted.encode()).decode() - if scheme in ('BLF-CRYPT', 'SHA256-CRYPT', 'SHA512-CRYPT') and \ - cfg_dget('misc.dovecot_version') < 0x20000b06: - scheme = 'CRYPT' return _format_digest(encrypted, scheme, encoding) @@ -403,11 +400,11 @@ JoouxdSqJO71l9Ld3tVrfOatEjarhghvEYADkq//LpDnTeO90tcbtHR1' if crypt('08/15!test~4711', '$2a$04$0123456789abcdefABCDEF$') == _blowfish: - _scheme_info['BLF-CRYPT'] = (_crypt_hash, 0x10000f00) + _scheme_info['BLF-CRYPT'] = (_crypt_hash, 0x20000b06) if crypt('08/15!test~4711', '$5$rounds=1000$0123456789abcdef$') == _sha256: - _scheme_info['SHA256-CRYPT'] = (_crypt_hash, 0x10000f00) + _scheme_info['SHA256-CRYPT'] = (_crypt_hash, 0x20000b06) if crypt('08/15!test~4711', '$6$rounds=1000$0123456789abcdef$') == _sha512: - _scheme_info['SHA512-CRYPT'] = (_crypt_hash, 0x10000f00) + _scheme_info['SHA512-CRYPT'] = (_crypt_hash, 0x20000b06) _test_crypt_algorithms() del _, cfg_dget, _test_crypt_algorithms |
|
From: <nev...@us...> - 2014-02-12 21:51:37
|
details: http://hg.localdomain.org/vmm/rev/348cd2cf9c18 changeset: 724:348cd2cf9c18 user: Pascal Volk date: Wed Feb 12 21:49:42 2014 +0000 description: pgsql/create_tables: Set default transport to lmtp. diffstat: pgsql/create_tables.pgsql | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 0cdd5e37f723 -r 348cd2cf9c18 pgsql/create_tables.pgsql --- a/pgsql/create_tables.pgsql Wed Feb 12 21:45:03 2014 +0000 +++ b/pgsql/create_tables.pgsql Wed Feb 12 21:49:42 2014 +0000 @@ -34,7 +34,7 @@ CONSTRAINT ukey_transport UNIQUE (transport) ); -- Insert default transport -INSERT INTO transport(transport) VALUES ('dovecot:'); +INSERT INTO transport(transport) VALUES ('lmtp:unix:private/dovecot-lmtp'); CREATE TABLE mailboxformat ( fid bigint NOT NULL DEFAULT nextval('mailboxformat_id'), |
|
From: <nev...@us...> - 2014-02-12 21:51:30
|
details: http://hg.localdomain.org/vmm/rev/0cdd5e37f723 changeset: 723:0cdd5e37f723 user: Pascal Volk date: Wed Feb 12 21:45:03 2014 +0000 description: pgsql: create_tables-dovecot-1.2.x.pgsql -> create_tables.pgsql diffstat: pgsql/create_tables-dovecot-1.2.x.pgsql | 652 --------------------------- pgsql/create_tables.pgsql | 770 ++++++++++++++++++++++++++++++++ 2 files changed, 770 insertions(+), 652 deletions(-) diffs (truncated from 1548 to 300 lines): diff -r e37f60b0e3b5 -r 0cdd5e37f723 pgsql/create_tables-dovecot-1.2.x.pgsql --- a/pgsql/create_tables-dovecot-1.2.x.pgsql Wed Feb 12 21:33:41 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,770 +0,0 @@ -SET client_encoding = 'UTF8'; -SET client_min_messages = warning; - - -CREATE SEQUENCE transport_id; - -CREATE SEQUENCE mailboxformat_id; - -CREATE SEQUENCE maillocation_id; - -CREATE SEQUENCE quotalimit_id; - -CREATE SEQUENCE service_set_id; - -CREATE SEQUENCE domain_gid - START WITH 70000 - INCREMENT BY 1 - MINVALUE 70000 - MAXVALUE 4294967294 - NO CYCLE; - -CREATE SEQUENCE users_uid - START WITH 70000 - INCREMENT BY 1 - MINVALUE 70000 - MAXVALUE 4294967294 - NO CYCLE; - - -CREATE TABLE transport ( - tid bigint NOT NULL DEFAULT nextval('transport_id'), - transport varchar(270) NOT NULL, -- smtps:[255-char.host.name:50025] - CONSTRAINT pkey_transport PRIMARY KEY (tid), - CONSTRAINT ukey_transport UNIQUE (transport) -); --- Insert default transport -INSERT INTO transport(transport) VALUES ('dovecot:'); - -CREATE TABLE mailboxformat ( - fid bigint NOT NULL DEFAULT nextval('mailboxformat_id'), - format varchar(20) NOT NULL, - CONSTRAINT pkey_mailboxformat PRIMARY KEY (fid), - CONSTRAINT ukey_mailboxformat UNIQUE (format) -); --- Insert supported mailbox formats -INSERT INTO mailboxformat(format) VALUES ('maildir'); -INSERT INTO mailboxformat(format) VALUES ('mdbox'); -INSERT INTO mailboxformat(format) VALUES ('sdbox'); - -CREATE TABLE maillocation ( - mid bigint NOT NULL DEFAULT nextval('maillocation_id'), - fid bigint NOT NULL DEFAULT 1, - directory varchar(20) NOT NULL, - extra varchar(1024), - CONSTRAINT pkey_maillocation PRIMARY KEY (mid), - CONSTRAINT fkey_maillocation_fid_mailboxformat FOREIGN KEY (fid) - REFERENCES mailboxformat (fid) -); --- Insert default Maildir-folder name -INSERT INTO maillocation(directory) VALUES ('Maildir'); - -CREATE TABLE quotalimit ( - qid bigint NOT NULL DEFAULT nextval('quotalimit_id'), - bytes bigint NOT NULL, - messages integer NOT NULL DEFAULT 0, - CONSTRAINT pkey_quotalimit PRIMARY KEY (qid), - CONSTRAINT ukey_quotalimit UNIQUE (bytes, messages) -); --- Insert default (non) quota limit -INSERT INTO quotalimit(bytes, messages) VALUES (0, 0); - -CREATE TABLE service_set ( - ssid bigint NOT NULL DEFAULT nextval('service_set_id'), - smtp boolean NOT NULL DEFAULT TRUE, - pop3 boolean NOT NULL DEFAULT TRUE, - imap boolean NOT NULL DEFAULT TRUE, - sieve boolean NOT NULL DEFAULT TRUE, - CONSTRAINT pkey_service_set PRIMARY KEY (ssid), - CONSTRAINT ukey_service_set UNIQUE (smtp, pop3, imap, sieve) -); --- Insert all possible service combinations -COPY service_set (smtp, pop3, imap, sieve) FROM stdin; -TRUE TRUE TRUE TRUE -FALSE TRUE TRUE TRUE -TRUE FALSE TRUE TRUE -FALSE FALSE TRUE TRUE -TRUE TRUE FALSE TRUE -FALSE TRUE FALSE TRUE -TRUE FALSE FALSE TRUE -FALSE FALSE FALSE TRUE -TRUE TRUE TRUE FALSE -FALSE TRUE TRUE FALSE -TRUE FALSE TRUE FALSE -FALSE FALSE TRUE FALSE -TRUE TRUE FALSE FALSE -FALSE TRUE FALSE FALSE -TRUE FALSE FALSE FALSE -FALSE FALSE FALSE FALSE -\. - -CREATE TABLE domain_data ( - gid bigint NOT NULL DEFAULT nextval('domain_gid'), - qid bigint NOT NULL DEFAULT 1, -- default quota limit - ssid bigint NOT NULL DEFAULT 1, -- default service set - tid bigint NOT NULL DEFAULT 1, -- default transport - domaindir varchar(40) NOT NULL, --/srv/mail/$RAND/4294967294 - note text NULL DEFAULT NULL, - CONSTRAINT pkey_domain_data PRIMARY KEY (gid), - CONSTRAINT fkey_domain_data_qid_quotalimit FOREIGN KEY (qid) - REFERENCES quotalimit (qid), - CONSTRAINT fkey_domain_data_ssid_service_set FOREIGN KEY (ssid) - REFERENCES service_set (ssid), - CONSTRAINT fkey_domain_data_tid_transport FOREIGN KEY (tid) - REFERENCES transport (tid) -); - -CREATE TABLE domain_name ( - domainname varchar(255) NOT NULL, - gid bigint NOT NULL, - is_primary boolean NOT NULL, - CONSTRAINT pkey_domain_name PRIMARY KEY (domainname), - CONSTRAINT fkey_domain_name_gid_domain_data FOREIGN KEY (gid) - REFERENCES domain_data (gid) -); - -CREATE TABLE users ( - local_part varchar(64) NOT NULL,-- only localpart w/o '@' - passwd varchar(270) NOT NULL, - name varchar(128) NULL, - uid bigint NOT NULL DEFAULT nextval('users_uid'), - gid bigint NOT NULL, - mid bigint NOT NULL DEFAULT 1, - qid bigint NULL DEFAULT NULL, - ssid bigint NULL DEFAULT NULL, - tid bigint NULL DEFAULT NULL, - note text NULL DEFAULT NULL, - CONSTRAINT pkey_users PRIMARY KEY (local_part, gid), - CONSTRAINT ukey_users_uid UNIQUE (uid), - CONSTRAINT fkey_users_gid_domain_data FOREIGN KEY (gid) - REFERENCES domain_data (gid), - CONSTRAINT fkey_users_mid_maillocation FOREIGN KEY (mid) - REFERENCES maillocation (mid), - CONSTRAINT fkey_users_qid_quotalimit FOREIGN KEY (qid) - REFERENCES quotalimit (qid), - CONSTRAINT fkey_users_ssid_service_set FOREIGN KEY (ssid) - REFERENCES service_set (ssid), - CONSTRAINT fkey_users_tid_transport FOREIGN KEY (tid) - REFERENCES transport (tid) -); - -CREATE TABLE userquota ( - uid bigint NOT NULL, - bytes bigint NOT NULL DEFAULT 0, - messages integer NOT NULL DEFAULT 0, - CONSTRAINT pkey_userquota PRIMARY KEY (uid), - CONSTRAINT fkey_userquota_uid_users FOREIGN KEY (uid) - REFERENCES users (uid) ON DELETE CASCADE -); - -CREATE TABLE alias ( - gid bigint NOT NULL, - address varchar(64) NOT NULL,-- only localpart w/o '@' - destination varchar(320) NOT NULL, - CONSTRAINT pkey_alias PRIMARY KEY (gid, address, destination), - CONSTRAINT fkey_alias_gid_domain_data FOREIGN KEY (gid) - REFERENCES domain_data (gid) -); - -CREATE TABLE relocated ( - gid bigint NOT NULL, - address varchar(64) NOT NULL, - destination varchar(320) NOT NULL, - CONSTRAINT pkey_relocated PRIMARY KEY (gid, address), - CONSTRAINT fkey_relocated_gid_domain_data FOREIGN KEY (gid) - REFERENCES domain_data (gid) -); - -CREATE TABLE catchall ( - gid bigint NOT NULL, - destination varchar(320) NOT NULL, - CONSTRAINT pkey_catchall PRIMARY KEY (gid, destination), - CONSTRAINT fkey_catchall_gid_domain_data FOREIGN KEY (gid) - REFERENCES domain_data (gid) -); - -CREATE OR REPLACE VIEW postfix_gid AS - SELECT gid, domainname - FROM domain_name; - -CREATE OR REPLACE VIEW vmm_domain_info AS - SELECT gid, count(uid) AS accounts, - (SELECT count(DISTINCT address) - FROM alias - WHERE alias.gid = domain_data.gid) AS aliases, - (SELECT count(gid) - FROM relocated - WHERE relocated.gid = domain_data.gid) AS relocated, - (SELECT count(gid) - FROM domain_name - WHERE domain_name.gid = domain_data.gid - AND NOT domain_name.is_primary) AS aliasdomains, - (SELECT count(gid) - FROM catchall - WHERE catchall.gid = domain_data.gid) AS catchall - FROM domain_data - LEFT JOIN domain_name USING (gid) - LEFT JOIN users USING (gid) - WHERE domain_name.is_primary - GROUP BY gid; - --- ########################################################################## -- - -CREATE LANGUAGE plpgsql; - --- ######################## TYPEs ########################################### -- - --- --- --- Data type for function postfix_virtual_mailbox(varchar, varchar) --- --- -CREATE TYPE address_maildir AS ( - address varchar(320), - maildir text -); --- --- --- Data type for function dovecotpassword(varchar, varchar) --- --- -CREATE TYPE dovecotpassword AS ( - userid varchar(320), - password varchar(270), - smtp boolean, - pop3 boolean, - imap boolean, - sieve boolean -); --- --- --- Data type for function dovecotquotauser(varchar, varchar) --- --- -CREATE TYPE dovecotquotauser AS ( - userid varchar(320), - uid bigint, - gid bigint, - home text, - mail text, - quota_rule text -); --- --- --- Data type for function dovecotuser(varchar, varchar) --- --- -CREATE TYPE dovecotuser AS ( - userid varchar(320), - uid bigint, - gid bigint, - home text, - mail text -); --- --- --- Data type for functions: postfix_relocated_map(varchar, varchar) --- postfix_virtual_alias_map(varchar, varchar) --- --- -CREATE TYPE recipient_destination AS ( - recipient varchar(320), - destination text -); --- --- --- Data type for function postfix_transport_map(varchar, varchar) --- --- -CREATE TYPE recipient_transport AS ( - recipient varchar(320), - transport text -); --- --- --- Data type for function postfix_virtual_uid_map(varchar, varchar) --- --- -CREATE TYPE recipient_uid AS ( - recipient varchar(320), - uid bigint -); --- --- --- Data type for function postfix_smtpd_sender_login_map(varchar, varchar) --- --- -CREATE TYPE sender_login AS ( - sender varchar(320), - login text -); - --- ######################## TRIGGERs ######################################## -- - -CREATE OR REPLACE FUNCTION domain_primary_trigger() RETURNS TRIGGER AS $$ -DECLARE - primary_count bigint; -BEGIN - SELECT INTO primary_count count(gid) + NEW.is_primary::integer - FROM domain_name - WHERE domain_name.gid = NEW.gid - AND is_primary; - |
|
From: <nev...@us...> - 2014-02-12 21:51:26
|
details: http://hg.localdomain.org/vmm/rev/e37f60b0e3b5 changeset: 722:e37f60b0e3b5 user: Pascal Volk date: Wed Feb 12 21:33:41 2014 +0000 description: VMM/password: Renamed _dovecotpw() -> _doveadmpw() diffstat: VirtualMailManager/password.py | 28 +++++++++++++--------------- 1 files changed, 13 insertions(+), 15 deletions(-) diffs (84 lines): diff -r 2f25d1cf8502 -r e37f60b0e3b5 VirtualMailManager/password.py --- a/VirtualMailManager/password.py Wed Feb 12 21:28:02 2014 +0000 +++ b/VirtualMailManager/password.py Wed Feb 12 21:33:41 2014 +0000 @@ -56,16 +56,14 @@ _get_salt = lambda s_len: ''.join(_choice(SALTCHARS) for x in range(s_len)) -def _dovecotpw(password, scheme, encoding): - """Communicates with dovecotpw (Dovecot 2.0: `doveadm pw`) and returns +def _doveadmpw(password, scheme, encoding): + """Communicates with Dovecot's doveadm and returns the hashed password: {scheme[.encoding]}hash """ if encoding: scheme = '.'.join((scheme, encoding)) - cmd_args = [cfg_dget('bin.dovecotpw'), '-s', scheme, '-p', + cmd_args = [cfg_dget('bin.doveadm'), 'pw', '-s', scheme, '-p', get_unicode(password)] - if cfg_dget('misc.dovecot_version') >= 0x20000a01: - cmd_args.insert(1, 'pw') process = Popen(cmd_args, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communicate() if process.returncode: @@ -73,7 +71,7 @@ hashed = stdout.strip().decode(ENCODING) if not hashed.startswith('{%s}' % scheme): raise VMMError('Unexpected result from %s: %s' % - (cfg_dget('bin.dovecotpw'), hashed), VMM_ERROR) + (cfg_dget('bin.doveadm'), hashed), VMM_ERROR) return hashed @@ -175,7 +173,7 @@ else: digest = b64encode(md4.digest()).decode() return _format_digest(digest, scheme, encoding) - return _dovecotpw(password, scheme, encoding) + return _doveadmpw(password, scheme, encoding) def _md5_hash(password, scheme, encoding, user=None): @@ -205,7 +203,7 @@ else: digest = b64encode(md4.digest()).decode() return _format_digest(digest, scheme, encoding) - return _dovecotpw(password, scheme, encoding) + return _doveadmpw(password, scheme, encoding) def _sha1_hash(password, scheme, encoding): @@ -287,26 +285,26 @@ _scheme_info = { 'CLEAR': (_clear_hash, 0x2010df00), 'CLEARTEXT': (_clear_hash, 0x10000f00), - 'CRAM-MD5': (_dovecotpw, 0x10000f00), + 'CRAM-MD5': (_doveadmpw, 0x10000f00), 'CRYPT': (_crypt_hash, 0x10000f00), 'DIGEST-MD5': (_md5_hash, 0x10000f00), - 'HMAC-MD5': (_dovecotpw, 0x10000f00), - 'LANMAN': (_dovecotpw, 0x10000f00), + 'HMAC-MD5': (_doveadmpw, 0x10000f00), + 'LANMAN': (_doveadmpw, 0x10000f00), 'LDAP-MD5': (_md5_hash, 0x10000f00), 'MD5': (_crypt_hash, 0x10000f00), 'MD5-CRYPT': (_crypt_hash, 0x10000f00), 'NTLM': (_ntlm_hash, 0x10000f00), - 'OTP': (_dovecotpw, 0x10100a01), + 'OTP': (_doveadmpw, 0x10100a01), 'PLAIN': (_clear_hash, 0x10000f00), 'PLAIN-MD4': (_md4_hash, 0x10000f00), 'PLAIN-MD5': (_md5_hash, 0x10000f00), - 'RPA': (_dovecotpw, 0x10000f00), - 'SCRAM-SHA-1': (_dovecotpw, 0x20200a01), + 'RPA': (_doveadmpw, 0x10000f00), + 'SCRAM-SHA-1': (_doveadmpw, 0x20200a01), 'SHA': (_sha1_hash, 0x10000f00), 'SHA1': (_sha1_hash, 0x10000f00), 'SHA256': (_sha256_hash, 0x10100a01), 'SHA512': (_sha512_hash, 0x20000b03), - 'SKEY': (_dovecotpw, 0x10100a01), + 'SKEY': (_doveadmpw, 0x10100a01), 'SMD5': (_smd5_hash, 0x10000f00), 'SSHA': (_ssha1_hash, 0x10000f00), 'SSHA256': (_ssha256_hash, 0x10200a04), |
|
From: <nev...@us...> - 2014-02-12 21:51:14
|
details: http://hg.localdomain.org/vmm/rev/2f25d1cf8502 changeset: 721:2f25d1cf8502 user: Pascal Volk date: Wed Feb 12 21:28:02 2014 +0000 description: VMM/mailbox: s/dovecotpw/doveadm/g PEP8 Fix: E127 in SingleDbox.__init__() diffstat: VirtualMailManager/mailbox.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r d1b32cdf8dda -r 2f25d1cf8502 VirtualMailManager/mailbox.py --- a/VirtualMailManager/mailbox.py Tue Feb 11 23:03:58 2014 +0000 +++ b/VirtualMailManager/mailbox.py Wed Feb 12 21:28:02 2014 +0000 @@ -244,12 +244,12 @@ For additional mailboxes use the add_boxes() method. """ assert cfg_dget('misc.dovecot_version') >= \ - account.mail_location.dovecot_version + account.mail_location.dovecot_version super(SingleDbox, self).__init__(account) def _doveadm_create(self, mailboxes, subscribe): """Wrap around Dovecot's doveadm""" - cmd_args = [cfg_dget('bin.dovecotpw'), 'mailbox', 'create', '-u', + cmd_args = [cfg_dget('bin.doveadm'), 'mailbox', 'create', '-u', str(self._user.address)] if subscribe: cmd_args.append('-s') |
|
From: <nev...@us...> - 2014-02-11 23:04:56
|
details: http://hg.localdomain.org/vmm/rev/d1b32cdf8dda changeset: 720:d1b32cdf8dda user: Pascal Volk date: Tue Feb 11 23:03:58 2014 +0000 description: {man,}/vmm.cfg: Updated vmm.cfg to match VMM/config. diffstat: man/man5/vmm.cfg.5 | 39 ++++++++++++--------------------------- vmm.cfg | 9 ++++----- 2 files changed, 16 insertions(+), 32 deletions(-) diffs (123 lines): diff -r 19486a140ef5 -r d1b32cdf8dda man/man5/vmm.cfg.5 --- a/man/man5/vmm.cfg.5 Tue Feb 11 22:55:28 2014 +0000 +++ b/man/man5/vmm.cfg.5 Tue Feb 11 23:03:58 2014 +0000 @@ -1,4 +1,4 @@ -.TH "VMM.CFG" "5" "2013-02-10" "vmm 0.7" "vmm" +.TH "VMM.CFG" "5" "2014-02-11" "vmm 0.7" "vmm" .SH NAME vmm.cfg \- configuration file for vmm .\" ----------------------------------------------------------------------- @@ -68,7 +68,7 @@ pass = xxxxxxxx [misc] -dovecot_version = 1.2.16 +dovecot_version = 2.2.11 .fi .\" ----------------------------------------------------------------------- .SH SEARCH ORDER @@ -165,32 +165,21 @@ .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) :" +.SS bin.doveadm +.BR doveadm " (default: /usr/bin/doveadm) :" .I String .PP The absolute path to the -.BR dovecotpw (1) +.BR doveadm (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'. +is set to one of `CRAM\-MD5', `HMAC\-MD5', `LANMAN', `OTP', `RPA', +`SCRAM-SHA-1' 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' +support the md4 hash algorithm (hashlib + OpenSSL) used for the password +schemes `PLAIN\-MD4' and `NTLM'. .PP The .BR doveadm (1) @@ -376,10 +365,10 @@ Determines whether newly created users can log in via SMTP (SMTP AUTH). .\" ------------------------------------ .SS domain.transport -.BR transport " (default: dovecot:) :" +.BR transport " (default: lmtp:unix:private/dovecot\-lmtp) :" .I String .PP -Default transport for domains and accounts. +Default transport for new domains. For details see .BR transport (5). .\" ----------------------------------------------------------------------- @@ -531,9 +520,6 @@ password_length = 10 random_password = true -[bin] -dovecotpw = /usr/bin/doveadm - [database] host = dbsrv8.example.net pass = PY_SRJ}L/0p\-oOk @@ -544,14 +530,13 @@ [domain] quota_bytes = 500M quota_messages = 10000 -transport = lmtp:unix:private/dovecot\-lmtp [mailbox] folders = Drafts:Sent:Templates:Trash:Lists.Dovecot:Lists.Postfix [misc] crypt_sha512_rounds = 10000 -dovecot_version = 2.0.beta4 +dovecot_version = 2.2.11 password_scheme = SHA512\-CRYPT.hex .fi .\" ----------------------------------------------------------------------- diff -r 19486a140ef5 -r d1b32cdf8dda vmm.cfg --- a/vmm.cfg Tue Feb 11 22:55:28 2014 +0000 +++ b/vmm.cfg Tue Feb 11 23:03:58 2014 +0000 @@ -102,9 +102,8 @@ ; ; With Dovecot >= v2.0.0 it's strongly recommended that you use Dovecot's ; lmtp instead of the dovecot-lda. -;transport = lmtp:unix:private/dovecot-lmtp -; default transport for domains and accounts (String) -transport = dovecot: +; default transport for new created domains (String) +transport = lmtp:unix:private/dovecot-lmtp # # Account settings @@ -127,8 +126,8 @@ # external binaries # [bin] -; location of dovecotpw (Dovecot v1) or doveadm (Dovecot v2) (String) -dovecotpw = /usr/sbin/dovecotpw +; location of doveadm (String) +doveadm = /usr/bin/doveadm ; location of disk usage (String) du = /usr/bin/du ; location of postconf (String) |
|
From: <nev...@us...> - 2014-02-11 23:04:45
|
details: http://hg.localdomain.org/vmm/rev/19486a140ef5 changeset: 719:19486a140ef5 user: Pascal Volk date: Tue Feb 11 22:55:28 2014 +0000 description: VMM/config: Updated default values for Dovecot ≥ 2.0.0 Renamed bin.dovecotpw -> bin.doveadm; default: /usr/bin/doveadm Updated domain.transport to lmtp:unix:private/dovecot-lmtp diffstat: VirtualMailManager/config.py | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diffs (28 lines): diff -r 65a29a373c19 -r 19486a140ef5 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Mon Feb 10 22:54:43 2014 +0000 +++ b/VirtualMailManager/config.py Tue Feb 11 22:55:28 2014 +0000 @@ -306,8 +306,7 @@ 'random_password': LCO(bool_t, False, self.getboolean), }, 'bin': { - 'dovecotpw': LCO(str, '/usr/sbin/dovecotpw', self.get, - exec_ok), + 'doveadm': LCO(str, '/usr/bin/doveadm', self.get, exec_ok), 'du': LCO(str, '/usr/bin/du', self.get, exec_ok), 'postconf': LCO(str, '/usr/sbin/postconf', self.get, exec_ok), }, @@ -331,11 +330,11 @@ 'quota_bytes': LCO(str, '0', self.get_in_bytes, check_size_value), 'quota_messages': LCO(int, 0, self.getint), - 'transport': LCO(str, 'dovecot:', self.get), + 'transport': LCO(str, 'lmtp:unix:private/dovecot-lmtp', + self.get), }, 'mailbox': { - 'folders': LCO(str, 'Drafts:Sent:Templates:Trash', - self.str), + 'folders': LCO(str, 'Drafts:Sent:Templates:Trash', self.str), 'format': LCO(str, 'maildir', self.get, check_mailbox_format), 'root': LCO(str, 'Maildir', self.str), 'subscribe': LCO(bool_t, True, self.getboolean), |
|
From: <nev...@us...> - 2014-02-10 22:55:20
|
details: http://hg.localdomain.org/vmm/rev/65a29a373c19 changeset: 718:65a29a373c19 user: Pascal Volk date: Mon Feb 10 22:54:43 2014 +0000 description: doc/web: Replaced vmm.cfg by a symbolic link. diffstat: doc/web/source/_static/vmm.cfg | 155 +---------------------------------------- 1 files changed, 1 insertions(+), 154 deletions(-) diffs (160 lines): diff -r 22f61779d34f -r 65a29a373c19 doc/web/source/_static/vmm.cfg --- a/doc/web/source/_static/vmm.cfg Mon Feb 10 20:39:55 2014 +0000 +++ b/doc/web/source/_static/vmm.cfg Mon Feb 10 22:54:43 2014 +0000 @@ -1,154 +1,1 @@ -# This is the vmm (a virtual mail manager) configuration file. -# default location: /usr/local/etc/vmm.cfg -# - -# -# Database settings -# -[database] -; Hostname or IP address of the database server (String) -host = localhost -; The TCP port, on which the database server is listening for connections (Int) -port = 5432 -; SSL mode for the database connection (String) -; Possible values are: -; * disabled -; * allow -; * prefer (default) -; * require -; * verify-ca (PostgreSQL >= 8.4) -; * verify-full (PostgreSQL >= 8.4) -sslmode = prefer -; Database user name (String) -user = vmm -; Database password (String) -pass = dbpassword -; Database name (String) -name = mailsys - -# -# mailbox settings -# -[mailbox] -; The mailbox format to be used for user's mailboxes. (String) -; Depending on the used Dovecot version there are up to 3 supported formats: -; * maildir - since Dovecot v1.0.0 -; * mdbox - since Dovecot v2.0.beta5 -; * sdbox - since Dovecot v2.0.rc3 -format = maildir -; A colon separated list of mailbox names, that should be created (String) -; e.g.: folders = Drafts:Sent:Templates:Trash:Lists.Dovecot:Lists.Postfix -folders = Drafts:Sent:Templates:Trash -; Name of the mailbox root directory in a user's home. (String) -; Usually used names (format: name): -; * maildir: Maildir -; * mdbox: mdbox -; * sdbox: sdbox -root = Maildir -; Set to true if the mailboxes from the folders option should be listed in -; the subscriptions file. (Boolean) -subscribe = true - -# -# Domain settings -# -[domain] -; Should vmm create the postmaster account when a new domain is created? -; (Boolean) -auto_postmaster = true -; Delete domain directory recursive when deleting a domain? (Boolean) -delete_directory = false -; Permissions for domain directories (Int) -; octal 0770 -> decimal 504 -directory_mode = 504 -; Force deletion of accounts and aliases when deleting a domain (Boolean) -force_deletion = false -; -; The service settings will be evaluated and applied when a domain is -; created. The service settings of the domain will be applied when you -; create a new account. -; Use the subcommand domainservices to modify a domain's service settings. -; Or userservices in order to update the service setting of an account. -; Allow smtp by default? (Boolean) -smtp = true -; Allow pop3 by default? (Boolean) -pop3 = true -; Allow imap by default? (Boolean) -imap = true -; Allow managesieve by default? (Boolean) -sieve = true -; -; The quota_* settings will be evaluated and applied when a domain is -; created. The domain's quota_* settings will be applied when an account -; is added to a domain. -; Use the subcommand domainquota to modify a domain's quota limits. -; Or userquota in order to update an account's quota limits. -; Quota limit in bytes. 0 means unlimited (String) -; The value can have one of the suffixes: -; * b: bytes -; * k: kilobytes -; * M: megabytes -; * G: gigabytes -; 1024 is the same as 1024b or 1k -quota_bytes = 0 -; Quota limit in number of messages. 0 means unlimited (Int) -quota_messages = 0 -; -; The transport setting will be evaluated and applied when a domain is -; created. The domain's transport setting will be applied when an account -; is added to a domain. -; Use the subcommand domaintransport to modify the transport of a domain. -; Or usertransport in order to update an account's transport setting. -; -; With Dovecot >= v2.0.0 it's strongly recommended that you use Dovecot's -; lmtp instead of the dovecot-lda. -;transport = lmtp:unix:private/dovecot-lmtp -; default transport for domains and accounts (String) -transport = dovecot: - -# -# Account settings -# -[account] -; Delete the user's home directory recursive when deleting an account? (Boolean) -delete_directory = false -; Permissions for the user's home directory and mail directories (Int) -; octal 0700 -> decimal 448 -directory_mode = 448 -; Display disk usage in account info by default? (Boolean) -disk_usage = false -; Should vmm generate a random password when no password was given for the -; useradd subcommand? (Boolean) -random_password = false -; How many characters to include in the generated passwords? (Int) -password_length = 8 - -# -# external binaries -# -[bin] -; location of dovecotpw (Dovecot v1) or doveadm (Dovecot v2) (String) -dovecotpw = /usr/sbin/dovecotpw -; location of disk usage (String) -du = /usr/bin/du -; location of postconf (String) -postconf = /usr/sbin/postconf - -# -# misc settings -# -[misc] -; The base directory for all domains/accounts (String) -base_directory = /srv/mail -; Number of encryption rounds for the password_scheme BLF-CRYPT (Int) -crypt_blowfish_rounds = 5 -; Number of encryption rounds for the password_scheme SHA256-CRYPT (Int) -crypt_sha256_rounds = 5000 -; Number of encryption rounds for the password_scheme SHA512-CRYPT (Int) -crypt_sha512_rounds = 5000 -; the version number from `dovecot --version` (String) -; e.g. 1.2.17, 2.0.21, 2.1.9 or 2.2.beta1 -dovecot_version = 2.1.9 -; Password scheme to use (see also: ´vmm listpwschemes`) (String) -password_scheme = CRAM-MD5 - +../../../../vmm.cfg \ No newline at end of file |
|
From: <nev...@us...> - 2014-02-10 20:41:58
|
details: http://hg.localdomain.org/vmm/rev/22f61779d34f changeset: 717:22f61779d34f user: Pascal Volk date: Mon Feb 10 20:39:55 2014 +0000 description: ext/postconf: Corrected a typo in a docstring. diffstat: VirtualMailManager/ext/postconf.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 915c14b21db3 -r 22f61779d34f VirtualMailManager/ext/postconf.py --- a/VirtualMailManager/ext/postconf.py Sun Feb 09 14:37:51 2014 +0000 +++ b/VirtualMailManager/ext/postconf.py Mon Feb 10 20:39:55 2014 +0000 @@ -56,7 +56,7 @@ raise VMMError(stderr.strip().decode(), VMM_ERROR) def read(self, parameter, expand_vars=True): - """Returns the parameters value. + """Returns the parameter's value. If expand_vars is True (default), all variables in the value will be expanded: |
|
From: <nev...@us...> - 2014-02-09 15:00:39
|
details: http://hg.localdomain.org/vmm/rev/915c14b21db3 changeset: 716:915c14b21db3 user: Pascal Volk date: Sun Feb 09 14:37:51 2014 +0000 description: VMM/config: Updated Dovecot version check. Renamed function check_version_format() -> check_dovecot_version(). Now this function checks also if misc.dovecot_version >= MIN_DOVECOT_VERSION. diffstat: VirtualMailManager/config.py | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diffs (59 lines): diff -r c6a33da1aa93 -r 915c14b21db3 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Sat Feb 08 18:36:30 2014 +0000 +++ b/VirtualMailManager/config.py Sun Feb 09 14:37:51 2014 +0000 @@ -16,8 +16,9 @@ from io import StringIO from VirtualMailManager.common import VERSION_RE, \ - exec_ok, expand_path, get_unicode, lisdir, size_in_bytes, version_hex -from VirtualMailManager.constants import CONF_ERROR + exec_ok, expand_path, get_unicode, lisdir, size_in_bytes, version_hex, \ + version_str +from VirtualMailManager.constants import CONF_ERROR, MIN_DOVECOT_VERSION from VirtualMailManager.errors import ConfigError, VMMError from VirtualMailManager.maillocation import known_format from VirtualMailManager.password import verify_scheme as _verify_scheme @@ -345,7 +346,7 @@ 'crypt_sha256_rounds': LCO(int, 5000, self.getint), 'crypt_sha512_rounds': LCO(int, 5000, self.getint), 'dovecot_version': LCO(str, None, self.hexversion, - check_version_format), + check_dovecot_version), 'password_scheme': LCO(str, 'CRAM-MD5', self.get, verify_scheme), }, @@ -430,9 +431,10 @@ """Check settings for which the possible values are known.""" if not miss_vers: value = self.get('misc', 'dovecot_version') - if not VERSION_RE.match(value): - self._missing['misc'] = ['version: ' + - _("Not a valid Dovecot version: '%s'") % value] + try: + checked = check_dovecot_version(value) + except ConfigValueError as err: + self._missing['misc'] = ['dovecot_version: %s' % str(err)] # section database db_err = [] value = self.dget('database.sslmode') @@ -497,14 +499,18 @@ return value -def check_version_format(version_string): - """Check if the *version_string* has the proper format, e.g.: '1.2.3'. +def check_dovecot_version(version_string): + """Check if the *version_string* has the proper format, e.g.: '2.0.0', + and if the configured version is >= MIN_DOVECOT_VERSION. Returns the validated version string if it has the expected format. Otherwise a `ConfigValueError` will be raised. """ if not VERSION_RE.match(version_string): raise ConfigValueError(_("Not a valid Dovecot version: '%s'") % get_unicode(version_string)) + if version_hex(version_string) < MIN_DOVECOT_VERSION: + raise ConfigValueError(_("vmm requires Dovecot >= %s") % + version_str(MIN_DOVECOT_VERSION)) return version_string |
|
From: <nev...@us...> - 2014-02-08 18:37:32
|
details: http://hg.localdomain.org/vmm/rev/c6a33da1aa93 changeset: 715:c6a33da1aa93 user: Pascal Volk date: Sat Feb 08 18:36:30 2014 +0000 description: VMM/constants: Added MIN_DOVECOT_VERSION (>= 2.0.0). diffstat: VirtualMailManager/constants.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (11 lines): diff -r 95252b15fffb -r c6a33da1aa93 VirtualMailManager/constants.py --- a/VirtualMailManager/constants.py Sat Feb 08 18:33:25 2014 +0000 +++ b/VirtualMailManager/constants.py Sat Feb 08 18:36:30 2014 +0000 @@ -28,6 +28,7 @@ MIN_GID = 70000 MIN_UID = 70000 +MIN_DOVECOT_VERSION = 0x20000f00 # exit codes |
|
From: <nev...@us...> - 2014-02-08 18:34:42
|
details: http://hg.localdomain.org/vmm/rev/95252b15fffb changeset: 714:95252b15fffb user: Pascal Volk date: Sat Feb 08 18:33:25 2014 +0000 description: VMM/cli/handler: Updated `skip_some_checks' conditions. diffstat: VirtualMailManager/cli/handler.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (14 lines): diff -r 74ee0a62039c -r 95252b15fffb VirtualMailManager/cli/handler.py --- a/VirtualMailManager/cli/handler.py Mon Feb 03 20:22:29 2014 +0000 +++ b/VirtualMailManager/cli/handler.py Sat Feb 08 18:33:25 2014 +0000 @@ -40,8 +40,8 @@ """ # Overwrite the parent CTor partly, we use the CliConfig class # and add some command line checks. - skip_some_checks = os.sys.argv[1] in ('cf', 'configure', 'h', 'help', - 'v', 'version') + skip_some_checks = os.sys.argv[1] in ('cf', 'configure', + 'cs', 'configset') super(CliHandler, self).__init__(skip_some_checks) self._cfg = Cfg(self._cfg_fname) |