Commit Graph
3082 Commits
Author SHA1 Message Date
Andrew Fyfe 441ba2affd getaddresses() expects a list 2018-01-25 17:40:31 +00:00
Antoine NguyenandGitHub 363c91d9f3 Merge pull request #1363 from fyfe/prepare-for-release
prepare for release
2018-01-25 10:35:14 +01:00
Antoine Nguyen c6e25b0c77 travis: fixed deploy condition syntax. 2018-01-25 10:01:57 +01:00
Antoine Nguyen 14f5d9da34 Updated travis config to include a deploy step. 2018-01-25 09:40:50 +01:00
Antoine Nguyen cfb228f1f7 Updated translations. 2018-01-25 09:32:22 +01:00
Andrew Fyfe 0c24969663 update migrations 2018-01-24 23:13:24 +00:00
Andrew Fyfe 4f98ffbb4d don't silence pip
it can provide useful information when you break something
2018-01-24 22:39:50 +00:00
Andrew Fyfe 5b94bf5e5b update documentation for Django upgrade (#1333) 2018-01-24 21:07:50 +00:00
Antoine NguyenandGitHub db8ec0458e Merge pull request #1360 from fyfe/feature/improve-email-address-parser
improve e-mail address splitting functions
2018-01-22 22:04:45 +01:00
Andrew Fyfe 18a089dc66 split domain on the last @ 2018-01-22 20:14:22 +00:00
Andrew Fyfe 31b9f7afd0 parse lists of e-mail recipients properly
closes #1310
2018-01-19 20:15:13 +00:00
Andrew Fyfe 7e5a9b9ebb improve e-mail address splitting functions
Needed for modoboa/modoboa-amavis#89
2018-01-19 20:15:13 +00:00
Antoine NguyenandGitHub 5b279f533a Merge pull request #1352 from modoboa/feature/per_domain_dkim_key
Per domain DKIM key generation.
2018-01-19 11:14:06 +01:00
Antoine Nguyen f6528adb71 Set 2048 bits as the default length. 2018-01-19 10:37:59 +01:00
Antoine Nguyen ff2c019fc6 Few fixes. 2018-01-19 09:56:24 +01:00
Antoine NguyenandGitHub 48608727f4 Merge pull request #1357 from fyfe/feature/refactor-cryptutils
refactor cryptutils
2018-01-18 09:02:37 +01:00
Andrew Fyfe e8ab4e2912 refactor cryptutils
Cryptography can be a black art, rather than rolling our own crypto
functions use the ones provided by the Python Cryptography module.

- `encrypt()` and `decrypt()`
    - ECB is insecure and the Python Cryptography module recommends[1]
    against using it.  The Python Cryptography module offers Fernet[2]
    for encrypting values using a secret_key.

    - Djangos `settings.SECRET_KEY` exists for things like encrypting
      passwords, use it instead of Modoboas own `secret_key`.

    - `settings.SECRET_KEY` is truncated to 32 characters as Fernet
      requires a key 32 characters long.

- `random_key()` uses Dangos get_random_string() method, the same
code used to generate settings.SECRET_KEY

- add tests for cryptutil methods

[1] https://cryptography.io/en/latest/hazmat/primitives/symmetric-encryption/?highlight=ecb#insecure-modes
[2] https://cryptography.io/en/latest/fernet/
2018-01-17 22:49:17 +00:00
Antoine Nguyen 3cebf2db1a Improve coverage. 2018-01-13 09:53:42 +01:00
Antoine NguyenandGitHub 958f2e0ad2 Merge pull request #1353 from fyfe/feature/refactor-setup.py
refactor setup.py
2018-01-13 09:31:01 +01:00
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
Antoine Nguyen e0aa745f7e Fix py3 compat! 2018-01-12 20:52:21 +01:00
Antoine NguyenandGitHub daeccd8833 Merge pull request #1351 from fyfe/feature/deployment-checks
Feature/deployment checks
2018-01-12 20:38:05 +01:00
Antoine Nguyen 9761ffff0f Fixed py3 compat. 2018-01-12 20:34:45 +01:00
Andrew Fyfe dd6aa98a54 update docs 2018-01-12 18:36:12 +00:00
Andrew Fyfe f04259dbee silence security.W019 check
Modoboa uses iframes to display e-mails so X_FRAME_OPTIONS can't be set
to DENY.
2018-01-12 18:36:11 +00:00
Andrew Fyfe 21a3164b77 create a deployment check to ensure USE_TZ is enabled
Fixes #1086
2018-01-12 18:36:11 +00:00
Antoine NguyenandGitHub f8d997b964 Merge pull request #1350 from fyfe/fix/reorder-doveadm-paramteres
fix order of doveadm paramters
2018-01-12 19:18:20 +01:00
Antoine Nguyen 61187da429 Fixed javascript issue. 2018-01-12 19:08:57 +01:00
Antoine Nguyen 32c1fdee0e Fixed unit test. 2018-01-12 18:59:19 +01: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 213a363716 Per domain DKIM key generation.
see #1325
2018-01-12 17:42:04 +01:00
Andrew Fyfe d4d403d4a0 fix order of doveadm paramters
Fixes #1267

also remove u prefix from exception string.
2018-01-12 15:32:31 +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