debian/0000700000000000000000000000000012207467467007173 5ustar debian/watch0000600000000000000000000000136312207462600010211 0ustar # Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # See uscan(1) for format # Compulsory line, this is a version 3 file version=3 # Uncomment to examine a Webpage # #http://www.example.com/downloads.php vmm-(.*)\.tar\.gz # Uncomment to examine a Webserver directory #http://www.example.com/pub/vmm-(.*)\.tar\.gz # Uncommment to examine a FTP server #ftp://ftp.example.com/pub/vmm-(.*)\.tar\.gz debian uupdate # Uncomment to find new files on sourceforge, for devscripts >= 2.9 http://sf.net/vmm/vmm-(.*)\.tar\.gz # Uncomment to find new files on GooglePages # http://example.googlepages.com/foo.html vmm-(.*)\.tar\.gz debian/changelog0000600000000000000000000000170112207466523011036 0ustar vmm (0.6.1-1) unstable; urgency=low * New upstream release. * Added Vcs-* fields to control data. * Updated Standards-Version to 3.9.4. * Split documentation into vmm-doc package. * Cherry-picked from upstream: - c853492, which fixes a TypeError-related crash, due to a typo; - e5011d7, which removes a "spy"-link to sf.net from the docs; -- martin f. krafft Sun, 25 Aug 2013 07:34:37 +0200 vmm (0.6.0-2) unstable; urgency=low * Unconditionally create mail spool directories (closes: #681209). * Remove README.source template as there are no special source handling procedures for this package at the moment, beyond dpkg v3. * Manually compress vmm.cfg.5 manpage due to dh_compress peculiarity. -- martin f. krafft Thu, 12 Jul 2012 09:01:38 +0200 vmm (0.6.0-1) unstable; urgency=low * Initial release. -- martin f. krafft Sat, 07 Apr 2012 14:17:52 +0200 debian/vmm.manpages0000600000000000000000000000004212207462600011465 0ustar man/man1/vmm.1 man/man5/vmm.cfg.5 debian/compat0000600000000000000000000000000212207462600010353 0ustar 8 debian/vmm.docs0000600000000000000000000000005512207462600010626 0ustar NEWS README TODO INSTALL Configure.Dovecot_2 debian/vmm.dirs0000600000000000000000000000003212207462600010632 0ustar usr/share/vmm var/lib/vmm debian/vmm.examples0000600000000000000000000000001612207462600011511 0ustar postfix pgsql debian/gbp.conf0000600000000000000000000000015512207466523010605 0ustar [DEFAULT] pristine-tar = True pristine-tar-commit = True debian-branch=master upstream-tag = vmm-%(version)s debian/pydist-overrides0000600000000000000000000000003112207462600012406 0ustar psycopg2 python-psycopg2 debian/dbc-archive/0000700000000000000000000000000012207462600011322 5ustar debian/dbc-archive/vmm.config0000600000000000000000000000052612207462600013315 0ustar #!/bin/sh . /usr/share/debconf/confmodule # source dbconfig-common shell library, and call the hook function if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then . /usr/share/dbconfig-common/dpkg/config.pgsql dbc_dbtypes="pgsql" dbc_authmethod_user="password" dbc_dbuser="vmmadmin" dbc_dbname="vmm" dbc_go vmm "$@" fi debian/dbc-archive/vmm.postinst0000600000000000000000000000242212207462600013730 0ustar #!/bin/sh # postinst script for vmm # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/postinst.pgsql dbc_pgsql_createdb_encoding="UTF-8" dbc_generate_include="template:/etc/vmm/vmm-db.cfg" dbc_generate_include_owner="root" dbc_generate_include_perms="0600" dbc_generate_include_args="--options template_infile=/usr/share/vmm/vmm-db.cfg.in --ucf" dbc_go vmm "$@" # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/dbc-archive/vmm.prerm0000600000000000000000000000171012207462600013171 0ustar #!/bin/sh # prerm script for vmm # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm.pgsql dbc_go vmm "$@" # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/dbc-archive/vmm.postrm0000600000000000000000000000213512207462600013372 0ustar #!/bin/sh # postrm script for vmm # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac [ -f /usr/share/debconf/confmodule ] && . /usr/share/debconf/confmodule [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ] && . /usr/share/dbconfig-common/dpkg/postrm.pgsql dbc_go vmm "$@" # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/vmm.postinst0000600000000000000000000000235312207462600011564 0ustar #!/bin/sh # postinst script for vmm # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) if [ -z "$2" ]; then addgroup --quiet --system vmm chmod 771 /var/lib/vmm for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do mkdir --parent --mode=751 /var/lib/vmm/$i done chgrp -R vmm /etc/vmm /var/lib/vmm fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/source/0000700000000000000000000000000012207462600010453 5ustar debian/source/format0000600000000000000000000000001412207462600011663 0ustar 3.0 (quilt) debian/vmm.install0000600000000000000000000000032612207466523011355 0ustar vmm usr/sbin vmm.cfg etc/vmm vmm-db.cfg etc/vmm UPGRADE usr/share/doc/vmm/upgrade update_config.py usr/share/doc/vmm/upgrade upgrade.sh usr/share/doc/vmm/upgrade usr/lib/python2.7/dist-packages/VirtualMailManager* debian/control0000600000000000000000000000233412207463571010572 0ustar Source: vmm Section: mail Priority: extra Maintainer: martin f. krafft Build-Depends: debhelper (>= 8.9.7), python, python-setuptools, python-sphinx Standards-Version: 3.9.4 Homepage: http://vmm.localdomain.org/ Vcs-Git: git://git.debian.org/git/collab-maint/vmm.git Vcs-Browser: http://git.debian.org/?p=collab-maint/vmm.git Package: vmm Architecture: all Depends: ${python:Depends}, ${misc:Depends}, dovecot-core (>= 2) Recommends: postfix, dovecot-lmtpd (>= 2), dovecot-pgsql (>= 2), postgresql-client Description: manage mail domains/accounts/aliases for Dovecot and Postfix Virtual Mail Manager is a command-line tool for administrators/postmasters to manage (alias-)domains, accounts, aliases and relocated users. It is designed for Dovecot and Postfix with a PostgreSQL backend. Package: vmm-doc Architecture: all Section: doc Depends: ${misc:Depends} Description: Documentation for the Virtual Mail Manager Virtual Mail Manager is a command-line tool for administrators/postmasters to manage (alias-)domains, accounts, aliases and relocated users. It is designed for Dovecot and Postfix with a PostgreSQL backend. . This package provides the documentation for vmm, as well as the VirtualMailManager API. debian/rules0000700000000000000000000000222312207463571010242 0ustar #!/usr/bin/make -f # -*- makefile -*- #export DH_VERBOSE=1 %: dh $@ --with python2,sphinxdoc override_dh_auto_build-indep: dh_auto_build --indep $(MAKE) -C doc/api html mv doc/api/build/html doc/api/build/api $(MAKE) -C doc/web html override_dh_sphinxdoc: dh_sphinxdoc || : override_dh_python2: dh_python2 # ugly hack because: # < POX> looks like doko bumped the minimum dependency because pycompile wasn't # propagating python's py_compile exit status # and yet it works just fine on squeeze… sed -i 's/2\.6\.6-7~/2.6.6-3~/' debian/vmm.substvars override_dh_installdocs: dh_installdocs mv debian/vmm/usr/share/doc/vmm/INSTALL \ debian/vmm/usr/share/doc/vmm/HOWTO override_dh_fixperms: dh_fixperms chmod -R o=,g=rX,u=rwX debian/vmm/etc/vmm override_dh_compress: dh_compress -X.pgsql -X.cf # dh_compress seems to give precedence to -X, so we must manually # compress the following manpage, whose name matches the second # exclusion pattern: gzip -9 debian/vmm/usr/share/man/man5/vmm.cfg.5 override_dh_clean: dh_clean $(MAKE) -C doc/api clean $(MAKE) -C doc/web clean python setup.py clean rm -rf VirtualMailManager.egg-info debian/patches/0000700000000000000000000000000012207467340010610 5ustar debian/patches/0008-Disable-sphinx-build-colours.patch0000600000000000000000000000177712207467340017667 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Disable sphinx-build colours I don't want colours in my build output. Please. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- doc/api/Makefile | 2 +- doc/web/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/Makefile b/doc/api/Makefile index 7c60ae0..b3fb25c 100644 --- a/doc/api/Makefile +++ b/doc/api/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build +SPHINXBUILD = sphinx-build -N PAPER = BUILDDIR = build diff --git a/doc/web/Makefile b/doc/web/Makefile index c114b74..7a2d941 100644 --- a/doc/web/Makefile +++ b/doc/web/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build +SPHINXBUILD = sphinx-build -N PAPER = BUILDDIR = build debian/patches/0009-Make-Sphinx-use-the-local-Objects-inventory-cache.patch0000600000000000000000000000151312207467340023470 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Make Sphinx use the local Objects inventory cache Use the locally cached version, else an HTTP download has to be made during build. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- doc/api/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/source/conf.py b/doc/api/source/conf.py index 8fe7783..8b30993 100644 --- a/doc/api/source/conf.py +++ b/doc/api/source/conf.py @@ -196,6 +196,6 @@ latex_documents = [ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {'http://docs.python.org/': 'objects.inv'} todo_include_todos = True debian/patches/0002-Debianise-install-instructions.patch0000600000000000000000000000320712207467340020305 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Debianise install instructions The installation instructions aren't applicable to users of the Debian packages and hence need a work-over. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- INSTALL | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index 52e0789..f84fb39 100644 --- a/INSTALL +++ b/INSTALL @@ -75,15 +75,15 @@ Configuring PostgreSQL # connect to the new database psql mailsys vmm -W -h 127.0.0.1 # either import the database structure for Dovecot v1.0.x/v1.1.x - \i vmm-y.x.z/pgsql/create_tables.pgsql + \i /usr/share/doc/vmm/examples/pgsql/create_tables.pgsql # or import the database structure for Dovecot v1.2.x/v2.x - \i vmm-x.y.z/pgsql/create_tables-dovecot-1.2.x.pgsql + \i /usr/share/doc/vmm/examples/pgsql/create_tables-dovecot-1.2.x.pgsql # leave psql \q # set permissions for your Dovecot and Postfix users # see python set-permissions.py -h for details - python vmm-x.y.z/pgsql/set-permissions.py -a -H 127.0.0.1 -U vmm + python /usr/share/doc/vmm/examples/pgsql/set-permissions.py -a -H 127.0.0.1 -U vmm Create directory for your mails mkdir /srv/mail @@ -208,7 +208,7 @@ Configuring Postfix's main.cf Installing the Virtual Mail Manager and configure the rest - Installing from Mercurial or vmm-x.y.z.tar.gz + Installing from Mercurial after cloning from the hg repo or extracting the archive change into the new directory and type: ./install.sh debian/patches/0007-Disable-Python-compilation-and-optimisation.patch0000600000000000000000000000116512207467340022635 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Disable Python compilation and optimisation These happen later during the Debian package build, so don't do them twice and disable the first time. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 08068f1..2523e52 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [install] -compile = 1 -optimize = 1 +compile = 0 +optimize = 0 [sdist] formats = bztar debian/patches/series0000600000000000000000000000107612207467340012033 0ustar 0001-Split-database-config-into-separate-file.patch 0002-Debianise-install-instructions.patch 0003-Debianise-config-file-locations.patch 0004-Loosen-config-file-permission-checks.patch 0005-Remove-interactive-configuration-CLI.patch 0006-Debian-specific-changes-to-configuration-defaults.patch 0007-Disable-Python-compilation-and-optimisation.patch 0008-Disable-sphinx-build-colours.patch 0009-Make-Sphinx-use-the-local-Objects-inventory-cache.patch 0010-Cherry-pick-VMM-account-Fixed-a-typo-in-Account.dele.patch 0011-Cherry-pick-doc-web-Removed-layout.html-template.patch debian/patches/0010-Cherry-pick-VMM-account-Fixed-a-typo-in-Account.dele.patch0000600000000000000000000000222312207467340023631 0ustar From: Pascal Volk Date: Sun, 9 Dec 2012 15:08:09 +0000 Subject: Cherry-pick: VMM/account: Fixed a typo in Account.delete(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to a wrong placed comma `userdelete … force' ended in a TypeError. (cherry picked from commit c853492634a10120e85e6f1afeb0008570b04f9f) Signed-off-by: martin f. krafft --- VirtualMailManager/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMailManager/account.py b/VirtualMailManager/account.py index cb7711c..df4b039 100644 --- a/VirtualMailManager/account.py +++ b/VirtualMailManager/account.py @@ -440,7 +440,7 @@ class Account(object): self._chk_state() dbc = self._dbh.cursor() if force: - dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid),) + dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid,)) # delete also all aliases where the destination address is the same # as for this account. dbc.execute("DELETE FROM alias WHERE destination = %s", debian/patches/0003-Debianise-config-file-locations.patch0000600000000000000000000000212212207467340020244 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Debianise config file locations Debian keeps the configuration in /etc/vmm. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- VirtualMailManager/handler.py | 2 +- vmm.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VirtualMailManager/handler.py b/VirtualMailManager/handler.py index e7cfcb1..06598a4 100644 --- a/VirtualMailManager/handler.py +++ b/VirtualMailManager/handler.py @@ -49,7 +49,7 @@ _db_mod = None CFG_FILE = 'vmm.cfg' CFG_DB_FILE = 'vmm-db.cfg' -CFG_PATH = '/root:/usr/local/etc:/etc' +CFG_PATH = '/etc/vmm' RE_DOMAIN_SEARCH = """^[a-z0-9-\.]+$""" OTHER_TYPES = { TYPE_ACCOUNT: (_(u'an account'), ACCOUNT_EXISTS), diff --git a/vmm.cfg b/vmm.cfg index 5dffc12..17332a0 100644 --- a/vmm.cfg +++ b/vmm.cfg @@ -1,5 +1,5 @@ # This is the vmm (a virtual mail manager) configuration file. -# default location: /usr/local/etc/vmm.cfg +# default location: /etc/vmm/vmm.cfg # # debian/patches/0001-Split-database-config-into-separate-file.patch0000600000000000000000000001254712207467340022010 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Split database config into separate file As the database configuration contains the password, it should be stored in a file that can be secured. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- VirtualMailManager/cli/handler.py | 5 +++-- VirtualMailManager/config.py | 5 ++++- VirtualMailManager/handler.py | 5 ++++- vmm-db.cfg | 28 ++++++++++++++++++++++++++++ vmm.cfg | 27 +-------------------------- 5 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 vmm-db.cfg diff --git a/VirtualMailManager/cli/handler.py b/VirtualMailManager/cli/handler.py index 7ad2747..a9fbdf9 100644 --- a/VirtualMailManager/cli/handler.py +++ b/VirtualMailManager/cli/handler.py @@ -11,7 +11,7 @@ import os from VirtualMailManager.errors import VMMError -from VirtualMailManager.handler import Handler +from VirtualMailManager.handler import Handler, CFG_PATH from VirtualMailManager.cli import read_pass from VirtualMailManager.cli.config import CliConfig as Cfg from VirtualMailManager.constants import ACCOUNT_EXISTS, INVALID_SECTION, \ @@ -44,7 +44,8 @@ class CliHandler(Handler): 'v', 'version') super(CliHandler, self).__init__(skip_some_checks) - self._cfg = Cfg(self._cfg_fname) + db = map(lambda p: os.path.join(p, CFG_DB_FILE), CFG_PATH.split(':')) + self._cfg = Cfg(self._cfg_fname, db) self._cfg.load() def cfg_set(self, option, value): diff --git a/VirtualMailManager/config.py b/VirtualMailManager/config.py index 5935092..c5064aa 100644 --- a/VirtualMailManager/config.py +++ b/VirtualMailManager/config.py @@ -283,7 +283,7 @@ class LazyConfigOption(object): class Config(LazyConfig): """This class is for reading vmm's configuration file.""" - def __init__(self, filename): + def __init__(self, filename, alt_cfg_filesnames=()): """Creates a new Config instance Arguments: @@ -293,6 +293,7 @@ class Config(LazyConfig): """ LazyConfig.__init__(self) self._cfg_filename = filename + self._cfg_alternate_filenames = alt_cfg_filesnames self._cfg_file = None self._missing = {} @@ -363,6 +364,8 @@ class Config(LazyConfig): self._cfg_file = open(self._cfg_filename, 'r') try: self.readfp(self._cfg_file) + if self._cfg_alternate_filenames: + self.read(self._cfg_alternate_filenames) except (MissingSectionHeaderError, ParsingError), err: raise ConfigError(str(err), CONF_ERROR) self._cfg_file.close() diff --git a/VirtualMailManager/handler.py b/VirtualMailManager/handler.py index 7a3e6c0..e7cfcb1 100644 --- a/VirtualMailManager/handler.py +++ b/VirtualMailManager/handler.py @@ -48,6 +48,7 @@ _ = lambda msg: msg _db_mod = None CFG_FILE = 'vmm.cfg' +CFG_DB_FILE = 'vmm-db.cfg' CFG_PATH = '/root:/usr/local/etc:/etc' RE_DOMAIN_SEARCH = """^[a-z0-9-\.]+$""" OTHER_TYPES = { @@ -81,8 +82,10 @@ class Handler(object): if os.geteuid(): raise NotRootError(_(u"You are not root.\n\tGood bye!\n"), CONF_NOPERM) + + db = map(lambda p: os.path.join(p, CFG_DB_FILE), CFG_PATH.split(':')) if self._check_cfg_file(): - self._cfg = Cfg(self._cfg_fname) + self._cfg = Cfg(self._cfg_fname, db) self._cfg.load() if not skip_some_checks: self._cfg.check() diff --git a/vmm-db.cfg b/vmm-db.cfg new file mode 100644 index 0000000..39fbaa7 --- /dev/null +++ b/vmm-db.cfg @@ -0,0 +1,28 @@ +# +# Database settings +# +[database] +; The Python PostgreSQL database adapter module to be used (String) +; Supported modules are: +; * psycopg2 +; * pyPgSQL +module = psycopg2 +; 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 = vmm diff --git a/vmm.cfg b/vmm.cfg index d407189..5dffc12 100644 --- a/vmm.cfg +++ b/vmm.cfg @@ -3,33 +3,8 @@ # # -# Database settings +# Database settings are exported to /etc/vmm/vmm-db.cfg on Debian. # -[database] -; The Python PostgreSQL database adapter module to be used (String) -; Supported modules are: -; * psycopg2 -; * pyPgSQL -module = psycopg2 -; 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 debian/patches/0005-Remove-interactive-configuration-CLI.patch0000600000000000000000000002572612207467340021253 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Remove interactive configuration CLI vmm provides interactive configuration file editing, which is just not fit for Debian (where people assume that files in /etc are not automatically changed). Let's just remove this functionality to guard against misunderstandings. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- INSTALL | 1 - VirtualMailManager/cli/handler.py | 36 +++----------- VirtualMailManager/cli/subcommands.py | 25 +--------- man/de/man1/vmm.1 | 91 ----------------------------------- man/man1/vmm.1 | 88 --------------------------------- 5 files changed, 7 insertions(+), 234 deletions(-) diff --git a/INSTALL b/INSTALL index f84fb39..4f3742f 100644 --- a/INSTALL +++ b/INSTALL @@ -222,7 +222,6 @@ Installing the Virtual Mail Manager and configure the rest # For Dovecot v1.x use 'dovecot:' as domain.transport # When using Dovecot v2.x use 'lmtp:unix:private/dovecot-lmtp' as # domain.transport - vmm configure # for help type # vmm(1) - command line tool to manage email domains/accounts/aliases diff --git a/VirtualMailManager/cli/handler.py b/VirtualMailManager/cli/handler.py index a9fbdf9..1856167 100644 --- a/VirtualMailManager/cli/handler.py +++ b/VirtualMailManager/cli/handler.py @@ -11,9 +11,8 @@ import os from VirtualMailManager.errors import VMMError -from VirtualMailManager.handler import Handler, CFG_PATH +from VirtualMailManager.handler import Handler from VirtualMailManager.cli import read_pass -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 @@ -22,10 +21,10 @@ _ = lambda msg: msg class CliHandler(Handler): - """This class uses a `CliConfig` for configuration stuff, instead of - the non-interactive `Config` class. - - It provides the additional methods cfgSet() and configure(). + """This class normally uses a `CliConfig` for configuration stuff, instead + of the non-interactive `Config` class. In Debian, however, CliConfig is + not necessary because the configuration will not be interactively + editable. Additionally it uses `VirtualMailManager.cli.read_pass()` for for the interactive password dialog. @@ -40,33 +39,10 @@ class CliHandler(Handler): """ # 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', + skip_some_checks = os.sys.argv[1] in ('h', 'help', 'v', 'version') super(CliHandler, self).__init__(skip_some_checks) - db = map(lambda p: os.path.join(p, CFG_DB_FILE), CFG_PATH.split(':')) - self._cfg = Cfg(self._cfg_fname, db) - self._cfg.load() - - def cfg_set(self, option, value): - """Set a new value for the given option.""" - return self._cfg.set(option, value) - - def configure(self, section=None): - """Starts the interactive configuration. - - Configures in interactive mode options in the given ``section``. - If no section is given (default) all options from all sections - will be prompted. - """ - if section is None: - self._cfg.configure(self._cfg.sections()) - elif self._cfg.has_section(section): - self._cfg.configure([section]) - else: - raise VMMError(_(u"Invalid section: '%s'") % section, - INVALID_SECTION) - def user_add(self, emailaddress, password=None): """Override the parent user_add() - add the interactive password dialog. diff --git a/VirtualMailManager/cli/subcommands.py b/VirtualMailManager/cli/subcommands.py index 7f13d6e..ad0c842 100644 --- a/VirtualMailManager/cli/subcommands.py +++ b/VirtualMailManager/cli/subcommands.py @@ -31,8 +31,7 @@ __all__ = ( 'Command', 'RunContext', 'cmd_map', 'usage', 'alias_add', 'alias_delete', 'alias_info', 'aliasdomain_add', 'aliasdomain_delete', 'aliasdomain_info', 'aliasdomain_switch', 'catchall_add', 'catchall_info', 'catchall_delete', - 'config_get', 'config_set', 'configure', - 'domain_add', 'domain_delete', 'domain_info', 'domain_quota', + 'config_get', 'domain_add', 'domain_delete', 'domain_info', 'domain_quota', 'domain_services', 'domain_transport', 'domain_note', 'get_user', 'help_', 'list_domains', 'list_pwschemes', 'list_users', 'list_aliases', 'list_relocated', 'list_addresses', 'relocated_add', 'relocated_delete', @@ -247,24 +246,6 @@ def config_get(ctx): noop)(ctx.cget(option)))) -def config_set(ctx): - """set a new value for the configuration option""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _(u'Missing option and new value.'), ctx.scmd) - if ctx.argc < 4: - usage(EX_MISSING_ARGS, _(u'Missing new configuration value.'), - ctx.scmd) - ctx.hdlr.cfg_set(ctx.args[2].lower(), ctx.args[3]) - - -def configure(ctx): - """start interactive configuration mode""" - if ctx.argc < 3: - ctx.hdlr.configure() - else: - ctx.hdlr.configure(ctx.args[2].lower()) - - def domain_add(ctx): """create a new domain""" if ctx.argc < 3: @@ -899,10 +880,6 @@ def update_cmd_map(): # cli commands 'configget': cmd('configget', 'cg', config_get, 'option', _('show the actual value of the configuration option')), - 'configset': cmd('configset', 'cs', config_set, 'option value', - _('set a new value for the configuration option')), - 'configure': cmd('configure', 'cf', configure, '[section]', - _(u'start interactive configuration mode')), 'listpwschemes': cmd('listpwschemes', 'lp', list_pwschemes, '', _(u'lists all usable password schemes and password ' u'encoding suffixes')), diff --git a/man/de/man1/vmm.1 b/man/de/man1/vmm.1 index ac92ca4..1f2158b 100644 --- a/man/de/man1/vmm.1 +++ b/man/de/man1/vmm.1 @@ -114,97 +114,6 @@ Beispiel: .B vmm configget misc.crypt_sha512_rounds misc.crypt_sha512_rounds = 5000 .fi -.\" -------------------------- -.SS configset (cs) -.B vmm configset -.I option value -.PP -Verwenden Sie diesen Unterbefehl, um einer einzelnen Konfigurationsoption -einen neuen Wert zuzuweisen. -.I option -ist der Name der Konfigurationsoption, -.I value -ist der Wert, der der Konfigurationsoption zugewiesen wird. -.IP Hinweis: -Diese Unterbefehl erstellt eine neue -.IR vmm.cfg , -ohne Kommentare. -Die aktuelle Konfigurationsdatei wird als -.IR vmm.cfg.bak -gesichert. -.PP -Beispiel: -.PP -.nf -.B vmm configget domain.transport -domain.transport = dovecot: -.B vmm configset domain.transport lmtp:unix:private/dovecot\-lmtp -.B vmm cg domain.transport -domain.transport = lmtp:unix:private/dovecot\-lmtp -.fi -.\" ------------------------------------ -.SS configure (cf) -.B vmm configure -.RI [ section ] -.PP -Startet die interaktiven Konfiguration für alle Konfigurationssektionen. -.PP -Dabei wird der aktuell konfigurierte Wert einer jeden Option in eckigen -Klammern ausgegeben. -Sollte kein Wert konfiguriert sein, wird der Vorgabewert der jeweiligen -Option in in eckigen Klammern angezeigt. -Um den angezeigten Wert unverändert zu übernehmen, ist dieser mit der -Eingabe\-Taste zu bestätigen. -.PP -Wurde das optionale Argument -.I section -angegeben, werden nur die Optionen der angegebenen Sektion angezeigt und -können geändert werden. -Folgende Sektionen sind vorhanden: -.RS -.TP 10 -.B account -Konto Einstellungen -.TP -.B bin -Pfade zu externen Binär\-Dateien -.TP -.B database -Datenbank Einstellungen -.TP -.B domain -Domain Einstellungen -.TP -.B mailbox -Mailbox Einstellungen -.TP -.B misc -Verschiedene Einstellungen -.RE -.PP -Die Konfigurationsoptionen werden in -.BR vmm.cfg (5) -beschrieben. -.IP Hinweis: -Diese Unterbefehl erstellt eine neue -.IR vmm.cfg , -ohne Kommentare. -Die aktuelle Konfigurationsdatei wird als -.IR vmm.cfg.bak -gesichert. -.PP -Beispiel: -.PP -.nf -.B vmm configure mailbox -Konfigurationsdatei wird verwendet: /root/vmm.cfg - -* Konfigurationsabschnitt: »mailbox« -Neuer Wert für Option folders [Drafts:Sent:Templates:Trash]: -Neuer Wert für Option format [maildir]: mdbox -Neuer Wert für Option subscribe [True]: -Neuer Wert für Option root [Maildir]: mdbox -.fi .\" ------------------------------------ .SS getuser (gu) .BI "vmm getuser" " uid" diff --git a/man/man1/vmm.1 b/man/man1/vmm.1 index 5c70812..8758b23 100644 --- a/man/man1/vmm.1 +++ b/man/man1/vmm.1 @@ -106,94 +106,6 @@ Example: misc.crypt_sha512_rounds = 5000 .fi .\" ------------------------------------ -.SS configset (cs) -.B vmm configset -.I option value -.PP -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 's -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 -.B vmm configget domain.transport -domain.transport = dovecot: -.B vmm configset domain.transport lmtp:unix:private/dovecot\-lmtp -.B vmm cg domain.transport -domain.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 -.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 -.B vmm configure mailbox -Using configuration file: /usr/local/etc/vmm.cfg - -* 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]: -Enter new value for option root [Maildir]: mdbox -.fi -.\" ------------------------------------ .SS getuser (gu) .BI "vmm getuser" " uid" .PP debian/patches/0011-Cherry-pick-doc-web-Removed-layout.html-template.patch0000600000000000000000000000316712207467340023405 0ustar From: Pascal Volk Date: Tue, 27 Aug 2013 21:13:28 +0000 Subject: Cherry-pick: doc/web: Removed layout.html template. (cherry picked from commit e5011d7f7498651df914f4bf7b0f0d9265d4a279) Signed-off-by: martin f. krafft --- doc/web/source/_templates/layout.html | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 doc/web/source/_templates/layout.html diff --git a/doc/web/source/_templates/layout.html b/doc/web/source/_templates/layout.html deleted file mode 100644 index 74b1164..0000000 --- a/doc/web/source/_templates/layout.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "!layout.html" %} -{%- block footer %} - -{%- endblock %} debian/patches/0006-Debian-specific-changes-to-configuration-defaults.patch0000600000000000000000000001061012207467340023661 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Debian-specific changes to configuration defaults I (as Debian package maintainer) disagree with some of the default assumptions made by upstream. This patch changes them to what I think should be the default, which are more suitable to Debian. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- Configure.Dovecot_2 | 2 +- INSTALL | 2 +- doc/web/source/_static/local.conf | 2 +- doc/web/source/installation/dovecot_configuration.rst | 4 ++-- vmm.cfg | 15 ++++++++------- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Configure.Dovecot_2 b/Configure.Dovecot_2 index 43c9d30..148e4ac 100644 --- a/Configure.Dovecot_2 +++ b/Configure.Dovecot_2 @@ -25,7 +25,7 @@ protocols = imap lmtp ### # conf.d/10-auth.conf ### -auth_mechanisms = plain login cram-md5 +auth_mechanisms = plain login passdb { driver = sql args = /usr/local/etc/dovecot/dovecot-sql.conf.ext diff --git a/INSTALL b/INSTALL index 4f3742f..8d6dfe3 100644 --- a/INSTALL +++ b/INSTALL @@ -106,7 +106,7 @@ Configuring Dovecot v1.x postmaster_address = postmaster@YOUR-DOMAIN.TLD } auth default { - mechanisms = cram-md5 login plain + mechanisms = login plain passdb sql { args = /etc/dovecot/dovecot-sql.conf } diff --git a/doc/web/source/_static/local.conf b/doc/web/source/_static/local.conf index 55e28f9..db4887f 100644 --- a/doc/web/source/_static/local.conf +++ b/doc/web/source/_static/local.conf @@ -9,7 +9,7 @@ ### # conf.d/10-auth.conf ### -auth_mechanisms = plain login cram-md5 +auth_mechanisms = plain login passdb { driver = sql args = /usr/local/etc/dovecot/dovecot-sql.conf.ext diff --git a/doc/web/source/installation/dovecot_configuration.rst b/doc/web/source/installation/dovecot_configuration.rst index 5d38f67..045ffa6 100644 --- a/doc/web/source/installation/dovecot_configuration.rst +++ b/doc/web/source/installation/dovecot_configuration.rst @@ -49,7 +49,7 @@ Use :command:`dovecot -n | head -n 1` to locate your :file:`dovecot.conf`. # sieve_storage = ~/sieve #} auth default { - mechanisms = cram-md5 login plain + mechanisms = login plain passdb sql { args = /etc/dovecot/dovecot-sql.conf } @@ -142,7 +142,7 @@ conf.d/10-auth.conf ^^^^^^^^^^^^^^^^^^^ .. code-block:: text - auth_mechanisms = plain login cram-md5 + auth_mechanisms = plain login passdb { driver = sql args = /usr/local/etc/dovecot/dovecot-sql.conf.ext diff --git a/vmm.cfg b/vmm.cfg index 17332a0..0cfa637 100644 --- a/vmm.cfg +++ b/vmm.cfg @@ -35,7 +35,9 @@ subscribe = true [domain] ; Should vmm create the postmaster account when a new domain is created? ; (Boolean) -auto_postmaster = true +; Debian: disabled because too rigid an assumption (usually postmaster@ is an +; alias) +auto_postmaster = false ; Delete domain directory recursive when deleting a domain? (Boolean) delete_directory = false ; Permissions for domain directories (Int) @@ -84,7 +86,7 @@ quota_messages = 0 ; lmtp instead of the dovecot-lda. ;transport = lmtp:unix:private/dovecot-lmtp ; default transport for domains and accounts (String) -transport = dovecot: +transport = lmtp:unix:private/dovecot-lmtp # # Account settings @@ -108,7 +110,7 @@ password_length = 8 # [bin] ; location of dovecotpw (Dovecot v1) or doveadm (Dovecot v2) (String) -dovecotpw = /usr/sbin/dovecotpw +dovecotpw = /usr/bin/doveadm ; location of disk usage (String) du = /usr/bin/du ; location of postconf (String) @@ -119,7 +121,7 @@ postconf = /usr/sbin/postconf # [misc] ; The base directory for all domains/accounts (String) -base_directory = /srv/mail +base_directory = /var/lib/vmm ; 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) @@ -128,7 +130,6 @@ crypt_sha256_rounds = 5000 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 +dovecot_version = 2.1.17 ; Password scheme to use (see also: ´vmm listpwschemes`) (String) -password_scheme = CRAM-MD5 - +password_scheme = SHA512-CRYPT debian/patches/0004-Loosen-config-file-permission-checks.patch0000600000000000000000000000261012207467340021256 0ustar From: "martin f. krafft" Date: Sun, 25 Aug 2013 07:55:30 +0200 Subject: Loosen config file permission checks While upstream insists on /etc/vmm/vmm.cfg to be mode 0600, 0640 is more suitable to Debian and co-administration. Signed-Off-By: martin f. krafft Signed-off-by: martin f. krafft --- VirtualMailManager/handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/VirtualMailManager/handler.py b/VirtualMailManager/handler.py index 06598a4..35bb633 100644 --- a/VirtualMailManager/handler.py +++ b/VirtualMailManager/handler.py @@ -111,11 +111,10 @@ class Handler(object): self._find_cfg_file() fstat = os.stat(self._cfg_fname) fmode = int(oct(fstat.st_mode & 0777)) - if fmode % 100 and fstat.st_uid != fstat.st_gid or \ - fmode % 10 and fstat.st_uid == fstat.st_gid: + if fmode != 640: # TP: Please keep the backticks around the command. `chmod 0600 …` raise PermissionError(_(u"wrong permissions for '%(file)s': " - u"%(perms)s\n`chmod 0600 %(file)s` would " + u"%(perms)s\n`chmod 0640 %(file)s` would " u"be great.") % {'file': self._cfg_fname, 'perms': fmode}, CONF_WRONGPERM) else: debian/vmm.lintian-overrides0000600000000000000000000000024612207462600013336 0ustar vmm: non-standard-dir-perm etc/vmm/ 0750 != 0755 vmm: non-standard-file-perm etc/vmm/vmm-db.cfg 0640 != 0644 vmm: non-standard-file-perm etc/vmm/vmm.cfg 0640 != 0644 debian/copyright0000600000000000000000000000333112207462600011110 0ustar Format: http://dep.debian.net/deps/dep5 Upstream-Name: vmm Source: http://vmm.localdomain.org/ Files: * Copyright: 2007–2012 Pascal Volk License: BSD-3-Clause Files: debian/* Copyright: 2012 martin f. krafft License: BSD-3-Clause License: BSD-3-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/README.Debian0000600000000000000000000000116012207462600011214 0ustar vmm for Debian -------------- The vmm package provides the VirtualMailManager software, but it does not attempt to do any autoconfiguration. I believe that this is better than trying to work the magic and integrate with Postfix and PostgreSQL, because I expect vmm to be used mainly by those who will want to customise the configuration anyway. Please find the instructions for the configuration in the file /usr/share/doc/vmm/INSTALL.gz and follow to your liking. If you have any suggestions, we welcome constructive and informative bug reports. -- martin f. krafft Thu Jun 28 16:40:01 CEST 2012 debian/vmm-doc.docs0000600000000000000000000000004512207463571011400 0ustar doc/api/build/api doc/web/build/html