Commit Graph
3052 Commits
Author SHA1 Message Date
Andrew Fyfe b4c0be2c9b add extra optional packages
Add the ability to install optional packages when installing modoboa. For example if I wanted to use modoboa with PostgreSQL `pip install modoboa[postgresql]`, or if I wanted MySQL and LDAP support `pip install modoboa[mysql,ldap]`

mysqlclient minimum version has been pined to 1.3.11 due to an issue with MariaDB 10 (#1341)
2018-01-12 22:45:09 +00:00
Andrew Fyfe dfabe89899 refactor setup.py
- use setuptools_scm to generate version number, normal releases will
use the tagged version (ie 1.9.1), versions installed from source will
append the git commit number to the version number (ie
1.9.1.dev61+g4584c93)

- use io.open() to read text files to correctly handle utf-8 characters

- use pip to parse requirements.txt

- update classifiers to specify python and django versions supported

- fix classifier for license

- wheel distributions can now be built using `python setup.py bdist_wheel`
2018-01-12 19:53:01 +00:00
Andrew Fyfe e8debf4e43 use setuptools parse_version for version comparision
adds support for version strings conformin to PEP 440

See https://www.python.org/dev/peps/pep-0440/
2018-01-12 16:55:39 +00:00
Antoine Nguyen 68b3158d08 Fixed configuration for 1.10.0. 2018-01-12 11:18:55 +01:00
Antoine NguyenandGitHub 3d7009b845 Merge pull request #1338 from fyfe/fix/update-docs
fix postfix documentation
2018-01-12 11:13:32 +01:00
Antoine NguyenandGitHub 07f0190eb1 Merge pull request #1342 from fyfe/fix/utf8-csv-import
Fix importing csv files containing utf8 characters
2018-01-09 11:16:05 +01:00
Andrew FyfeandGitHub 08ab044ed2 Merge pull request #1347 from fyfe/fix/remove-assert
remove unrequired assert
2018-01-08 20:01:15 +00:00
Andrew Fyfe 26d24b7ff0 remove unrequired assert
Testing code that shouldn't have been included with modoboa/modoboa#1330
2018-01-08 19:42:24 +00:00
Andrew Fyfe 181b51f986 PEP 8 fixes 2018-01-05 12:47:27 +00:00
Andrew Fyfe 425792d23d Fix importing csv files containing utf8 characters
The csv module on Python 2 doesn't support utf8 (even encoded as bytes), the easiest fix is to use the csv module backported from Python 3.

Fixes #1312

See https://docs.python.org/2/library/csv.html
See https://github.com/ryanhiebert/backports.csv
2018-01-05 12:47:21 +00:00
Andrew Fyfe 0ac1b415f2 fix postfix documentation
Fix instructions for a new installs, and upgrades to reflect recent changes.

- #1309 removed `sql-relaydomains-transport.cf`

- #1322 merged `sql-sender-login-*.cf` into `sql-sender-login-map.cf`

- remove duplicate `relay_domains`
2018-01-05 12:43:43 +00:00
Antoine NguyenandGitHub 71582c57cb Merge pull request #1339 from fyfe/fix/mx-check-ipv6-support
Add IPv6 support to mx checks
2018-01-05 11:59:35 +01:00
Andrew Fyfe 9ff4ca64e5 only query an ip address once during dnsbl checks
- IP addresses are used for DNSBL queries, only query each unique IP address once per DNSBL provider

- add support for MXs with IPv6 addresses

fixes #1335
2018-01-04 21:52:03 +00:00
Andrew Fyfe 5fb2f55a0a silence pep8 warnings for mixed case method names and append _ to reserved names 2018-01-04 21:52:03 +00:00
Andrew Fyfe 042d0a8501 add IPv6 support to mx check
- add support for looking up IPv6 addresses (socket.getaddrinfo)
- add support for International Domain Names in case the DNS reponse contains one, to_unicode() decodes them to a utf8 string
- add logging for potential configuration errors:
    - DNS configuration errors (i.e. no MX records)
    - server name resolution errors (i.e. resolv.conf doesn't contain a working name server)
    - invalid values in MX records
- when looking up an ip address, don't stop on the first failure check all addresses
- update mock results for tests, return a real MX record for mock dns queries
2018-01-04 21:52:02 +00:00
Antoine NguyenandGitHub 2c4fefca02 Merge pull request #1340 from fyfe/fix/test-db-setup
Fix test database setup
2018-01-04 18:28:02 +01:00
Andrew Fyfe 5d9add8fdc clean up codecov ignore paths 2018-01-04 16:36:52 +00:00
Andrew Fyfe 9923b9362f fix test database setup
Django automatically renames test databases to 'test_%s' % settings.DATABASES[*]["NAME"], so modoboa_test became test_modoboa_test. There's no point creating the database in `before script` as the test suite creates it.

https://docs.djangoproject.com/en/1.11/topics/testing/advanced/#django.db.connection.creation.create_test_db

- target oldest currently supported database servers, travis currently defaults to PostgreSQL 9.2 which isn't supported anymore.

- move database dependencies out of travis.yml into test_requirements.txt and pin to minimum versions recommended by django.
  See https://docs.djangoproject.com/en/1.11/ref/databases/

- use MySQL root user for tests, we already use the root user (postgres) for PostgreSQL.

- fix typo in modoboa/test_settings for DB variable, default should be POSTGRESQL not POSTGRES

- enable MySQL strict mode (on by default on MySQL >= 5.7)
  See https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode
2018-01-04 16:36:52 +00:00
Antoine Nguyen f9341633c6 Added possibility to insert headers in menu. 2018-01-04 13:50:14 +01:00
Antoine NguyenandGitHub e0f5b8b92a Merge pull request #1341 from fyfe/fix/mariadb-10.2-doc-updates
MariaDB >= 10.2 requires mysqlclient >= 1.3.11
2018-01-04 10:12:37 +01:00
Antoine NguyenandGitHub e000d2d795 Merge pull request #1330 from fyfe/improved-email-parser
Improved email parser
2018-01-04 09:44:01 +01:00
Andrew Fyfe 40bd2d6735 MariaDB >= 10.2 requires mysqlclient >= 1.3.11
fixes modoboa/modoboa-installer#136
2018-01-03 19:00:36 +00:00
Andrew Fyfe ea0cf90d48 add tests for modoboa.lib.email_utils.Email 2018-01-03 17:16:05 +00:00
Andrew Fyfe c984596ae9 improve modoboa.lib.email_utils.Email
This is a refactor of moboboa.lib.email_utils.Email, currently it has
trouble parsing messages containing certain attachment types.

For html messages inline images are now base64 encoded and embedded into
the <img> tag rather than being saved to disk.

This only effects modoboa-amavis as modoboa-webmail implements it's own
parser for e-mails as they are retrieved differently using IMAP.

This adds a new external dependency on lxml.
2018-01-03 17:16:04 +00:00
Andrew Fyfe 161570de70 split existing tests into tests directory 2018-01-03 17:13:13 +00:00
Andrew FyfeandAntoine Nguyen 168743f74b On error email admins (#1336)
* add option to e-mail errors to ADMINS

Set ADMINS to a list of all the people who get code error notifications.
When DEBUG=False Django emails these people the details of exceptions
raised in the request/response cycle.

* don't choke if settings.py contains utf8 characters
2017-12-21 17:52:54 +01:00
Antoine Nguyen 47154039e0 transport: updated SQL queries. 2017-12-21 11:32:53 +01:00
Antoine NguyenandGitHub 36a434f346 Reintroduced relay domain concept. (#1334)
* Reintroduced relay domain concept.

* Removed wrong url include.

* Removed deprecated tests.

* Updated requirement.
2017-12-21 11:15:02 +01:00
Antoine NguyenandGitHub bc1832fff1 Merge pull request #1333 from fyfe/upgrade-django
Upgrade Django (Django-1.10 no longer supported)
2017-12-21 09:46:57 +01:00
Antoine NguyenandGitHub 1fa9f346f5 Merge pull request #1332 from modoboa/feature/sender_address_api
New sender address API.
2017-12-19 11:41:36 +01:00
Antoine Nguyen 3903485970 New sender address API.
see #1331
2017-12-19 11:25:02 +01:00
Andrew Fyfe 92963a0f4c update test_project files
synced with a fresh deployment using django 1.11.8
2017-12-19 01:24:15 +00:00
Andrew Fyfe 33b37ec63e updated new deployment settings.py
- updated django urls to point to the current version
- renamed MIDDLEWARE_CLASSES to MIDDLEWARE, MIDDLEWARE_CLASSES is depreciated in django >= 1.10
- whitespace and #noqa fixes
2017-12-19 01:24:14 +00:00
Andrew Fyfe 4fe51d6726 random code clean ups
- removed duplicate imports
- whitespace fixes
- removed unnecessary u"" prefixes
- added missing r"" prefixes where required
- added missing default values to DynamicForm() to prevent possible unassigned variable access
2017-12-19 01:24:01 +00:00
Andrew Fyfe 8fb3e244f6 upgrade to django 1.11
pin to >=1.11.8 as thats the current version when the upgrade was done
2017-12-19 00:53:13 +00:00
Andrew Fyfe ba861965b7 upgrade dependencies with minor version updates 2017-12-19 00:53:13 +00:00
Andrew Fyfe 2e18acb8ad upgrade django-auth-ldap and fix depreciated warning 2017-12-19 00:53:13 +00:00
Andrew Fyfe 0cd444be6b django-reversion >= 2.0.0 should be used with django >= 1.8
https://django-reversion.readthedocs.io/en/stable/django-versions.html
2017-12-19 00:53:12 +00:00
Andrew Fyfe e8eb9a84c1 passlib 1.7 depreciated the use of <hash>.encrypt(), use <hash>.hash() 2017-12-19 00:53:12 +00:00
Andrew Fyfe 892160d5aa updates for django 1.11 support
- MIDDLEWARE_CLASSES is replaced by MIDDLEWARE

- add MiddlewareMixin to modoboa middlewares

- on_delete will become a required parameter for ForeignKey()
  set it to the current default CASCADE

- on_delete will become a required parameter for OneToOneField()
  set it to the current default CASCADE

- reverse and reverse_lazy have moved to django.urls

- RadioChoiceInput widget has been removed, replace with HorizontalRadioSelect
2017-12-19 00:50:53 +00:00
Andrew Fyfe 3308c56480 StopIterator has been depreciated, use return [PEP479]
https://www.python.org/dev/peps/pep-0479/#consequences-for-existing-code
2017-12-19 00:50:52 +00:00
Andrew Fyfe e6befb3de9 standardise travis.yml across modoboa extensions 2017-12-19 00:50:51 +00:00
Andrew FyfeandAntoine Nguyen 02663a41b6 escape html in plain text messages (#1326)
conditional_escape is used to prevent double escaping, ImapEmail.viewmail_plain()
in modoboa-webmail overrides this method and escapes content before calling
Email.viewmail_plain(), SQLemail in modoboa-amavis doesn't and can potentially
allow harmful html to be displayed.
2017-12-14 17:09:10 +01:00
Antoine NguyenandGitHub 1f9a4b0abf Fixed mailsploit vulnerability. (#1324)
see #1323
2017-12-08 13:17:53 +01:00
Antoine NguyenandGitHub b924a20793 Feature/merge sender login queries (#1322)
* Merged sender login related queries.

see #1164

* Added upgrade instructions.

* Fixed registration.
2017-12-08 10:45:08 +01:00
Antoine Nguyen 16720f423b Improved documentation. 2017-12-07 14:09:09 +01:00
Sketch ⌨️andAntoine Nguyen 3bf3c05213 Create rebuild_virtual_env.rst (#1293)
* Create rebuild_virtual_env.rst

After upgrading to Ubuntu 17.10 my virtualenv was trashed. I rebuilt it using instructions on pythonanywhere.com but felt that the modoboa documentation should have a file for rebuilding the instance.

* Add rebuild virtual environment documentation
2017-12-07 13:38:00 +01:00
Antoine NguyenandGitHub eba9cba00e Added polish translation. (#1319)
see #1318
2017-12-07 10:11:30 +01:00
Antoine Nguyen b81730ae40 Fixed domain sorting by tag. 2017-12-03 13:12:23 +01:00
Antoine Nguyen f793701389 Merge branch 'master' of github.com:modoboa/modoboa 2017-12-03 12:55:10 +01:00