Permalink
Browse files

Merge branch 'master' into feature/codacy

  • Loading branch information...
fyfe committed Apr 12, 2018
2 parents fcb4668 + f604aac commit 3bfd977e02e23d708f51ac15150dfde630fc7b62
Showing with 2,075 additions and 1,623 deletions.
  1. +30 −0 .editorconfig
  2. +1 −0 .gitignore
  3. +2 −0 .travis.yml
  4. +1 −1 README.rst
  5. +0 −1 bin/modoboa-admin.py
  6. +63 −59 doc/conf.py
  7. +19 −0 doc/configuration.rst
  8. +19 −9 doc/manual_installation/modoboa.rst
  9. +2 −9 doc/manual_installation/webserver.rst
  10. +6 −0 doc/upgrade.rst
  11. +1 −2 modoboa/__init__.py
  12. +2 −0 modoboa/admin/__init__.py
  13. +6 −7 modoboa/admin/api.py
  14. +4 −3 modoboa/admin/app_settings.py
  15. +3 −1 modoboa/admin/apps.py
  16. +2 −1 modoboa/admin/constants.py
  17. +19 −17 modoboa/admin/factories.py
  18. +13 −11 modoboa/admin/forms/__init__.py
  19. +11 −14 modoboa/admin/forms/account.py
  20. +5 −7 modoboa/admin/forms/alias.py
  21. +9 −13 modoboa/admin/forms/domain.py
  22. +2 −0 modoboa/admin/forms/export.py
  23. +2 −0 modoboa/admin/forms/forward.py
  24. +2 −0 modoboa/admin/forms/import_.py
  25. +8 −14 modoboa/admin/handlers.py
  26. +10 −12 modoboa/admin/lib.py
  27. +0 −1 modoboa/admin/management/__init__.py
  28. +0 −1 modoboa/admin/management/commands/__init__.py
  29. +7 −6 modoboa/admin/management/commands/handle_mailbox_operations.py
  30. +4 −2 modoboa/admin/management/commands/modo.py
  31. +0 −1 modoboa/admin/management/commands/subcommands/__init__.py
  32. +12 −5 modoboa/admin/management/commands/subcommands/_export.py
  33. +57 −11 modoboa/admin/management/commands/subcommands/_import.py
  34. +5 −0 modoboa/admin/management/commands/subcommands/_manage_dkim_keys.py
  35. +2 −3 modoboa/admin/management/commands/subcommands/_mx.py
  36. +9 −6 modoboa/admin/management/commands/subcommands/_repair.py
  37. +4 −2 modoboa/admin/models/__init__.py
  38. +10 −9 modoboa/admin/models/alias.py
  39. +3 −2 modoboa/admin/models/base.py
  40. +27 −13 modoboa/admin/models/domain.py
  41. +11 −10 modoboa/admin/models/domain_alias.py
  42. +15 −14 modoboa/admin/models/mailbox.py
  43. +2 −0 modoboa/admin/models/mxrecord.py
  44. +6 −4 modoboa/admin/postfix_maps.py
  45. +17 −13 modoboa/admin/serializers.py
  46. +3 −0 modoboa/admin/signals.py
  47. +19 −0 modoboa/admin/static/admin/js/admin.js
  48. +2 −2 modoboa/admin/templates/admin/_domain_dkim_key.html
  49. +1 −1 modoboa/admin/templates/admin/domains.html
  50. +0 −1 modoboa/admin/templatetags/__init__.py
  51. +10 −9 modoboa/admin/templatetags/admin_tags.py
  52. +0 −1 modoboa/admin/tests/__init__.py
  53. +1 −1 modoboa/admin/tests/dovecot
  54. +44 −47 modoboa/admin/tests/test_account.py
  55. +47 −44 modoboa/admin/tests/test_alias.py
  56. +24 −21 modoboa/admin/tests/test_api.py
  57. +2 −0 modoboa/admin/tests/test_data/import_domains.csv
  58. +3 −0 modoboa/admin/tests/test_data/import_domains_duplicates.csv
  59. +2 −0 modoboa/admin/tests/test_data/import_domains_iso8859.csv
  60. +23 −10 modoboa/admin/tests/test_domain.py
  61. +4 −5 modoboa/admin/tests/test_domain_alias.py
  62. +8 −10 modoboa/admin/tests/test_export.py
  63. +95 −14 modoboa/admin/tests/test_import_.py
  64. +11 −6 modoboa/admin/tests/test_mailbox_operations.py
  65. +2 −0 modoboa/admin/tests/test_mapfiles.py
  66. +34 −31 modoboa/admin/tests/test_mx.py
  67. +19 −18 modoboa/admin/tests/test_password_schemes.py
  68. +6 −7 modoboa/admin/tests/test_repair.py
  69. +2 −1 modoboa/admin/tests/test_user.py
  70. +3 −2 modoboa/admin/tests/utils.py
  71. +9 −8 modoboa/admin/urls.py
  72. +2 −1 modoboa/admin/urls_api.py
  73. +3 −2 modoboa/admin/views/__init__.py
  74. +15 −17 modoboa/admin/views/alias.py
  75. +4 −4 modoboa/admin/views/dns.py
  76. +34 −23 modoboa/admin/views/domain.py
  77. +12 −7 modoboa/admin/views/export.py
  78. +25 −26 modoboa/admin/views/identity.py
  79. +16 −11 modoboa/admin/views/import_.py
  80. +6 −6 modoboa/admin/views/user.py
  81. +2 −0 modoboa/core/__init__.py
  82. +12 −16 modoboa/core/app_settings.py
  83. +3 −1 modoboa/core/apps.py
  84. +3 −1 modoboa/core/checks/__init__.py
  85. +0 −1 modoboa/core/checks/settings_checks.py
  86. +7 −7 modoboa/core/commands/__init__.py
  87. +65 −69 modoboa/core/commands/deploy.py
  88. +5 −5 modoboa/core/commands/help.py
  89. +1 −1 modoboa/core/constants.py
  90. +2 −0 modoboa/core/context_processors.py
  91. +2 −0 modoboa/core/dev_settings.py
  92. +4 −2 modoboa/core/extensions.py
  93. +2 −0 modoboa/core/factories.py
  94. +4 −6 modoboa/core/forms.py
  95. +8 −11 modoboa/core/handlers.py
  96. +2 −0 modoboa/core/loggers.py
  97. +0 −1 modoboa/core/management/__init__.py
  98. +0 −1 modoboa/core/management/commands/__init__.py
  99. +3 −2 modoboa/core/management/commands/clean_inactive_accounts.py
  100. +5 −5 modoboa/core/management/commands/cleanlogs.py
  101. +3 −2 modoboa/core/management/commands/communicate_with_public_api.py
  102. +7 −5 modoboa/core/management/commands/generate_postfix_maps.py
  103. +4 −7 modoboa/core/management/commands/load_initial_data.py
  104. +4 −4 modoboa/core/management/commands/set_default_site.py
  105. +2 −0 modoboa/core/middleware.py
  106. +3 −1 modoboa/core/mocks.py
  107. +14 −16 modoboa/core/models.py
  108. +8 −6 modoboa/core/password_hashers/__init__.py
  109. +6 −5 modoboa/core/password_hashers/advanced.py
  110. +18 −10 modoboa/core/password_hashers/base.py
  111. +6 −4 modoboa/core/password_validation.py
  112. +2 −0 modoboa/core/signals.py
  113. +0 −1 modoboa/core/templatetags/__init__.py
  114. +12 −11 modoboa/core/templatetags/core_tags.py
  115. +0 −1 modoboa/core/tests/__init__.py
  116. +0 −1 modoboa/core/tests/stupid_extension_1/__init__.py
  117. +3 −0 modoboa/core/tests/stupid_extension_1/modo_extension.py
  118. +0 −1 modoboa/core/tests/stupid_extension_2/__init__.py
  119. +2 −0 modoboa/core/tests/stupid_extension_2/modo_extension.py
  120. +2 −0 modoboa/core/tests/stupid_extension_2/urls.py
  121. +2 −0 modoboa/core/tests/stupid_extension_2/views.py
  122. +20 −18 modoboa/core/tests/test_authentication.py
  123. +10 −12 modoboa/core/tests/test_core.py
  124. +2 −0 modoboa/core/tests/test_extensions.py
  125. +12 −13 modoboa/core/tests/test_ldap.py
  126. +7 −9 modoboa/core/tests/test_views.py
  127. +2 −0 modoboa/core/urls.py
  128. +5 −4 modoboa/core/utils.py
  129. +4 −1 modoboa/core/views/__init__.py
  130. +6 −7 modoboa/core/views/admin.py
  131. +8 −8 modoboa/core/views/auth.py
  132. +3 −2 modoboa/core/views/base.py
  133. +5 −4 modoboa/core/views/dashboard.py
  134. +7 −7 modoboa/core/views/user.py
  135. +0 −1 modoboa/lib/__init__.py
  136. +3 −1 modoboa/lib/api_client.py
  137. +4 −2 modoboa/lib/authbackends.py
  138. +13 −11 modoboa/lib/connections.py
  139. +3 −3 modoboa/lib/cryptutils.py
  140. +3 −3 modoboa/lib/db_utils.py
  141. +28 −28 modoboa/lib/email_utils.py
  142. +5 −4 modoboa/lib/exceptions.py
  143. +2 −0 modoboa/lib/fields.py
  144. +9 −10 modoboa/lib/form_utils.py
  145. +54 −54 modoboa/lib/imap_utf7.py
  146. +13 −12 modoboa/lib/ldap_utils.py
  147. +3 −1 modoboa/lib/listing.py
  148. +5 −5 modoboa/lib/middleware.py
  149. +2 −0 modoboa/lib/paginator.py
  150. +3 −3 modoboa/lib/permissions.py
  151. +2 −0 modoboa/lib/signals.py
  152. +9 −6 modoboa/lib/singleton.py
  153. +2 −2 modoboa/lib/sysutils.py
  154. +0 −1 modoboa/lib/templatetags/__init__.py
  155. +11 −9 modoboa/lib/templatetags/form_tags.py
  156. +10 −9 modoboa/lib/templatetags/lib_tags.py
  157. +2 −0 modoboa/lib/test_utils.py
  158. +7 −8 modoboa/lib/tests/__init__.py
  159. +7 −5 modoboa/lib/tests/test_email_utils.py
  160. +5 −5 modoboa/lib/tests/test_u2u_decode.py
  161. +2 −2 modoboa/lib/u2u_decode.py
  162. +4 −1 modoboa/lib/validators.py
  163. +5 −5 modoboa/lib/web_utils.py
  164. +2 −0 modoboa/limits/__init__.py
  165. +2 −0 modoboa/limits/app_settings.py
  166. +3 −1 modoboa/limits/apps.py
  167. +2 −1 modoboa/limits/constants.py
  168. +11 −12 modoboa/limits/forms.py
  169. +9 −15 modoboa/limits/handlers.py
  170. +2 −1 modoboa/limits/lib.py
  171. +2 −4 modoboa/limits/models.py
  172. +5 −2 modoboa/limits/serializers.py
  173. +0 −1 modoboa/limits/tests/__init__.py
  174. +15 −16 modoboa/limits/tests/test_api.py
  175. +4 −4 modoboa/limits/tests/test_domain_limits.py
  176. +9 −12 modoboa/limits/tests/test_import.py
  177. +165 −164 modoboa/limits/tests/test_user_limits.py
  178. +2 −1 modoboa/limits/urls_api.py
  179. +8 −6 modoboa/limits/utils.py
  180. +0 −3 modoboa/limits/views.py
  181. +3 −2 modoboa/limits/viewsets.py
  182. +0 −1 modoboa/parameters/__init__.py
  183. +3 −1 modoboa/parameters/apps.py
  184. +5 −4 modoboa/parameters/forms.py
  185. +0 −5 modoboa/parameters/tests.py
  186. +10 −7 modoboa/parameters/tools.py
  187. +2 −0 modoboa/relaydomains/__init__.py
  188. +4 −2 modoboa/relaydomains/apps.py
  189. +3 −2 modoboa/relaydomains/forms.py
  190. +4 −7 modoboa/relaydomains/handlers.py
  191. +3 −2 modoboa/relaydomains/lib.py
  192. +2 −0 modoboa/relaydomains/models.py
  193. +2 −0 modoboa/relaydomains/postfix_maps.py
  194. +10 −3 modoboa/relaydomains/serializers.py
  195. +53 −54 modoboa/relaydomains/tests.py
  196. +4 −0 modoboa/relaydomains/transport.py
  197. +4 −1 modoboa/relaydomains/urls_api.py
  198. +5 −2 modoboa/relaydomains/viewsets.py
  199. +3 −2 modoboa/static/js/global.js
  200. +4 −2 modoboa/static/js/twocols_nav.js
  201. +42 −27 modoboa/test_settings.py
  202. +4 −0 modoboa/transport/__init__.py
  203. +4 −3 modoboa/transport/apps.py
  204. +11 −4 modoboa/transport/backends.py
  205. +4 −0 modoboa/transport/constants.py
  206. +4 −0 modoboa/transport/factories.py
  207. +5 −3 modoboa/transport/forms.py
  208. +3 −4 modoboa/transport/handlers.py
  209. +3 −2 modoboa/transport/models.py
  210. +2 −0 modoboa/transport/postfix_maps.py
  211. +1 −0 modoboa/transport/static/transport/js/transport.js
  212. +11 −10 modoboa/urls.py
  213. +2 −1 modoboa/urls_api.py
  214. +1 −1 postgresql-requirements.txt
  215. +2 −3 requirements.txt
  216. +21 −0 setup.cfg
  217. +12 −8 setup.py
  218. +1 −3 test-requirements.txt
  219. +112 −113 test_project/test_project/settings.py
  220. +3 −1 tests.py
  221. +3 −0 tox.ini
View
@@ -0,0 +1,30 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{css,js,py}]
charset = utf-8
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
[{.travis.yml,codecov.yml}]
indent_style = space
indent_size = 2
# Ignore paths
[/modoboa/bower_components/**]
charset = none
end_of_line = none
insert_final_newline = none
trim_trailing_whitespace = none
indent_style = none
indent_size = none
View
@@ -11,6 +11,7 @@ DEV
.ropeproject
modoboa.iml
.tox
.eggs/
modoboa_test
.coverage
build/
View
@@ -37,6 +37,8 @@ install:
- pip install -r requirements.txt
- pip install -r ldap-requirements.txt
- pip install -r test-requirements.txt
- if [ $DB = POSTGRESQL ]; then pip install -r postgresql-requirements.txt ; fi
- if [ $DB = MYSQL ]; then pip install -r mysql-requirements.txt ; fi
- python setup.py develop
before_script:
View
@@ -30,11 +30,11 @@ Main features
* Reputation protection: `DNSBL <https://en.wikipedia.org/wiki/DNSBL>`_ checks, `DMARC <https://dmarc.org/>`_ `reports <https://github.com/modoboa/modoboa-dmarc>`_ and more
* `Amavis <http://www.amavis.org>`_ `frontend <https://github.com/modoboa/modoboa-amavis>`_
* `Webmail <https://github.com/modoboa/modoboa-webmail>`_
* `Calendar <https://github.com/modoboa/modoboa-radicale>`_
* `Address book <https://github.com/modoboa/modoboa-contacts>`_
* `Per-user Sieve filters <https://github.com/modoboa/modoboa-sievefilters>`_
* `Autoreply messages for Postfix <https://github.com/modoboa/modoboa-postfix-autoreply>`_
* `Graphical statistics about email traffic <https://github.com/modoboa/modoboa-stats>`_
* `Radicale <http://radicale.org/>`_ `management frontend <https://github.com/modoboa/modoboa-radicale>`_
*************
Documentation
View
@@ -7,4 +7,3 @@
if __name__ == "__main__":
handle_command_line()
View
@@ -11,217 +11,221 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
from __future__ import unicode_literals
import os
# import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.intersphinx',
"sphinx.ext.intersphinx",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']
templates_path = [".templates"]
# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = u'Modoboa'
copyright = u'2018, Antoine Nguyen'
project = "Modoboa"
copyright = "2018, Antoine Nguyen" # NOQA:A001
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.10'
version = "1.10"
# The full version, including alpha/beta/rc tags.
release = '1.10.0'
release = "1.10.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['.build']
exclude_patterns = [".build"]
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if on_rtd:
html_theme = 'default'
html_theme = "default"
else:
html_theme = 'nature'
html_theme = "nature"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Modoboadoc'
htmlhelp_basename = "Modoboadoc"
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Modoboa.tex', u'Modoboa Documentation',
u'Antoine Nguyen', 'manual'),
("index", "Modoboa.tex", "Modoboa Documentation",
"Antoine Nguyen", "manual"),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'modoboa', u'Modoboa Documentation',
[u'Antoine Nguyen'], 1)
("index", "modoboa", "Modoboa Documentation",
["Antoine Nguyen"], 1)
]
intersphinx_mapping = {
'amavis': ('http://modoboa-amavis.readthedocs.org/en/latest/', None)
"amavis": ("http://modoboa-amavis.readthedocs.org/en/latest/", None)
}
View
@@ -254,6 +254,25 @@ This parameter is optional but you must ensure it is set to ``False``
The default configuration file provided by the ``modoboa-admin.py``
command is properly configured.
**********************
Logging authentication
**********************
To trace login attempts to the web interface, Modoboa uses python
`SysLogHandler <https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler>`_
so you can see them in your syslog authentication log file
(`/var/log/auth.log` in most cases).
Depending on your configuration, you may have to edit the :file:`settings.py` file
and add `'address': '/dev/log'` to the logging section::
'syslog-auth': {
'class': 'logging.handlers.SysLogHandler',
'facility': SysLogHandler.LOG_AUTH,
'address': '/dev/log',
'formatter': 'syslog'
},
***********************
External authentication
***********************
Oops, something went wrong.

0 comments on commit 3bfd977

Please sign in to comment.