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/
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)
- 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`
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`
- 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
- 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
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
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.
* 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