Commit Graph
3041 Commits
Author SHA1 Message Date
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
Antoine Nguyen 3805993af2 Fixed translation issue.
fix #1304
2017-12-03 12:54:25 +01:00
Antoine NguyenandGitHub 80c2ee3e81 Added greek translation. (#1315)
see #1314
2017-12-02 15:01:55 +01:00
Antoine NguyenandGitHub 98eea782a0 Generic transport editor. (#1309)
Generic transport editor.

see #1301

* Fixed unit test.

* Added unit tests.

* Fixed unit test.

* Added transport module to test list.

* Moved relay transport backend to appropriate app.

see #1301

* Added missing file.
2017-11-27 10:42:27 +01:00
Anthony BourguignonandAntoine Nguyen 1129c94316 Fix mistake in french translation (#1306)
Fix #1303
2017-11-22 18:52:35 +01:00
Antoine Nguyen 9fe24607d1 Merge branch 'master' of github.com:modoboa/modoboa 2017-11-16 18:15:34 +01:00
Antoine Nguyen 7861bdcd9a Added missing extension.
fix #1277
2017-11-16 18:15:04 +01:00
TelskampandAntoine Nguyen e2c8fb1d94 updated/added translations (#1287) 2017-11-01 14:53:55 +01:00
TelskampandAntoine Nguyen 4370166372 translations fixed (#1286) 2017-11-01 14:53:30 +01:00
TelskampandAntoine Nguyen 6d747c19bd fixed translation (#1285) 2017-11-01 14:53:10 +01:00
TelskampandAntoine Nguyen 2abbce5c02 updated some dutch translations (#1284)
* updated some dutch translations

* fixed typos
2017-11-01 14:52:41 +01:00
Christophe CHAUVETandAntoine Nguyen e3c35560ed Impossible to enable domain on creation or update with coreapi (#1281)
I found a bug in the coreapi to create a domain
this problem is on the djangorestframework and fix ten days ago 

see: https://github.com/mozilla/mozillians/pull/1892
       https://github.com/encode/django-rest-framework/issues/1101
Fix: https://github.com/encode/django-rest-framework/pull/5038/files
2017-10-27 19:58:56 +02:00