diff --git a/CHANGELOG.md b/CHANGELOG.md index 44cf33f7..77a200ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,18 @@ Notable changes to this project are documented in the current file. For more details about individual changes, see the Git log. You should read this before upgrading Freposte.io as some changes will include useful notes. + + v1.6.1 - unreleased ------------------- - Enhancement: Make Unbound drop privileges after binding to port - Enhancement: Create an Authentication Token with IPv6 address restriction ([#829](https://github.com/Mailu/Mailu/issues/829)) -- Bug: Fix creating new fetched accounts - Enhancement: Missing wildcard option in alias flask command ([#869](https://github.com/Mailu/Mailu/issues/869)) +- Bug: Fix creating new fetched accounts - Bug: Fix poor performance if ANTIVIRUS is configured to none. - Bug: Implement mailustart to resolve webmail in admin ([#716](https://github.com/Mailu/Mailu/issues/716)) +- Bug: Rename cli commands and their options (replace "\_" with "-") ([#877](https://github.com/Mailu/Mailu/issues/877)) +- Bug: Fix typo in migration script ([#905](https://github.com/Mailu/Mailu/issues/905)) v1.6.0 - 2019-01-18 ------------------- diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 856fa5a0..059318fc 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -13,4 +13,4 @@ Before we can consider review and merge, please make sure the following list is If an entry in not applicable, you can check it or remove it from the list. - [ ] In case of feature or enhancement: documentation updated accordingly -- [ ] Unless it's docs or a minor change: place entry in the [changelog](CHANGELOG.md), under the latest un-released version. +- [ ] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file. diff --git a/core/admin/Dockerfile b/core/admin/Dockerfile index 4f887ff2..40f9ff59 100644 --- a/core/admin/Dockerfile +++ b/core/admin/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart # Image specific layers under this line diff --git a/core/admin/mailu/manage.py b/core/admin/mailu/manage.py index 3a8256ad..c39fc1b6 100644 --- a/core/admin/mailu/manage.py +++ b/core/admin/mailu/manage.py @@ -64,7 +64,7 @@ def admin(localpart, domain_name, password): @click.argument('localpart') @click.argument('domain_name') @click.argument('password') -@click.argument('hash_scheme') +@click.argument('hash_scheme', required=False) @flask_cli.with_appcontext def user(localpart, domain_name, password, hash_scheme=None): """ Create a user @@ -86,15 +86,18 @@ def user(localpart, domain_name, password, hash_scheme=None): @mailu.command() -@click.option('-n', '--domain_name') -@click.option('-u', '--max_users') -@click.option('-a', '--max_aliases') -@click.option('-q', '--max_quota_bytes') +@click.argument('domain_name') +@click.option('-u', '--max-users') +@click.option('-a', '--max-aliases') +@click.option('-q', '--max-quota-bytes') @flask_cli.with_appcontext def domain(domain_name, max_users=-1, max_aliases=-1, max_quota_bytes=0): + """ Create a domain + """ domain = models.Domain.query.get(domain_name) if not domain: - domain = models.Domain(name=domain_name) + domain = models.Domain(name=domain_name, max_users=max_users, + max_aliases=max_aliases, max_quota_bytes=max_quota_bytes) db.session.add(domain) db.session.commit() @@ -126,7 +129,7 @@ def user_import(localpart, domain_name, password_hash, hash_scheme = None): @mailu.command() @click.option('-v', '--verbose') -@click.option('-d', '--delete_objects') +@click.option('-d', '--delete-objects') @flask_cli.with_appcontext def config_update(verbose=False, delete_objects=False): """sync configuration with data from YAML-formatted stdin""" diff --git a/core/admin/migrations/versions/5aeb5811408e_.py b/core/admin/migrations/versions/5aeb5811408e_.py index 2ea06ea9..647a61f7 100644 --- a/core/admin/migrations/versions/5aeb5811408e_.py +++ b/core/admin/migrations/versions/5aeb5811408e_.py @@ -106,7 +106,7 @@ def upgrade(): # lower relays for relay in connection.execute(relay_table.select()): connection.execute(relay_table.update().where( - relay_tbale.c.name == relay.name + relay_table.c.name == relay.name ).values( name=relay.name.lower() )) diff --git a/core/dovecot/Dockerfile b/core/dovecot/Dockerfile index 02c9e49d..94432564 100644 --- a/core/dovecot/Dockerfile +++ b/core/dovecot/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart diff --git a/core/dovecot/conf/dovecot.conf b/core/dovecot/conf/dovecot.conf index b7cca76c..f4181e0c 100644 --- a/core/dovecot/conf/dovecot.conf +++ b/core/dovecot/conf/dovecot.conf @@ -84,6 +84,7 @@ service auth-worker { ############### protocol imap { mail_plugins = $mail_plugins imap_quota imap_sieve + mail_max_userip_connections = 20 } protocol pop3 { diff --git a/core/nginx/Dockerfile b/core/nginx/Dockerfile index 9bc4c745..0156cccf 100644 --- a/core/nginx/Dockerfile +++ b/core/nginx/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart diff --git a/core/postfix/Dockerfile b/core/postfix/Dockerfile index 4b6c4aee..3eff5218 100644 --- a/core/postfix/Dockerfile +++ b/core/postfix/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart diff --git a/docs/cli.rst b/docs/cli.rst index bdf4a6d1..bdd030f9 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -4,11 +4,12 @@ Mailu command line Managing users and aliases can be done from CLI using commands: * alias -* alias_delete +* alias-delete +* domain * user -* user_import -* user_delete -* config_update +* user-import +* user-delete +* config-update alias ----- @@ -18,44 +19,54 @@ alias docker-compose exec admin flask mailu alias foo example.net "mail1@example.com,mail2@example.com" -alias_delete +alias-delete ------------ .. code-block:: bash - docker-compose exec admin flask mailu alias_delete foo@example.net + docker-compose exec admin flask mailu alias-delete foo@example.net + + +domain +---- + +.. code-block:: bash + + docker-compose exec admin flask mailu domain example.net + user ---- .. code-block:: bash - docker-compose exec admin flask mailu user --hash_scheme='SHA512-CRYPT' myuser example.net 'password123' + docker-compose exec admin flask mailu user myuser example.net 'password123' -user_import + +user-import ----------- primary difference with simple `user` command is that password is being imported as a hash - very useful when migrating users from other systems where only hash is known. .. code-block:: bash - docker-compose run --rm admin python manage.py user --hash_scheme='SHA512-CRYPT' myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' + docker-compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT' -user_delete +user-delete ------------ .. code-block:: bash - docker-compose exec admin flask mailu user_delete foo@example.net + docker-compose exec admin flask mailu user-delete foo@example.net -config_update +config-update ------------- The sole purpose of this command is for importing users/aliases in bulk and synchronizing DB entries with external YAML template: .. code-block:: bash - cat mail-config.yml | docker-compose exec admin flask mailu config_update --delete_objects + cat mail-config.yml | docker-compose exec -T admin flask mailu config-update --delete-objects where mail-config.yml looks like: @@ -72,7 +83,7 @@ where mail-config.yml looks like: domain: example.com destination: "user1@example.com,user2@example.com" -without ``--delete_object`` option config_update will only add/update new values but will *not* remove any entries missing in provided YAML input. +without ``--delete-object`` option config-update will only add/update new values but will *not* remove any entries missing in provided YAML input. Users ----- diff --git a/docs/contributors/guide.rst b/docs/contributors/guide.rst index a3b6d95a..0ae15c03 100644 --- a/docs/contributors/guide.rst +++ b/docs/contributors/guide.rst @@ -69,6 +69,24 @@ After some testing on master, we will approve and merge this new PR as well. At the end of every milestone, a new stable branch will be created from ``master`` or any previous commit that matches the completion of the milestone. +CHANGELOG +````````` + +Adding entries in the CHANGELOG is an automated process which requires creation of a file under +``towncrier/newsfragments`` directory. + +The start of the filename is the ticket number, and the content is what will end up in the news file. +For example, if ticket ``#850`` is about adding a new widget, the filename would be towncrier/newsfragments/850.feature +and the content would be ``Feature that has just been added``. + +Supported file extensions are: + +- ``.feature``: Signifying a new feature. +- ``.bugfix``: Signifying a bug fix. +- ``.doc``: Signifying a documentation improvement. +- ``.removal``: Signifying a deprecation or removal of public API. +- ``.misc``: A ticket has been closed, but it is not of interest to users. + Forked projects --------------- diff --git a/docs/faq.rst b/docs/faq.rst index 2053bfe4..9d69f2c5 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -464,3 +464,7 @@ We **strongly** advice against downgrading the TLS version and ciphers! .. _`681`: https://github.com/Mailu/Mailu/pull/681 .. _`698`: https://github.com/Mailu/Mailu/issues/698 .. _`unbound`: https://nlnetlabs.nl/projects/unbound/about/ + +A user gets ``Sender address rejected: Access denied. Please check the`` ``message recipient […] and try again`` even though the sender is legitimate? +`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` +First, check if you are really sure the user is a legitimate sender, i.e. the registered user is authenticated successfully and own either the account or alias he/she is trying to send from. If you are really sure this is correct, then the user might try to errornously send via port 25 insteadof the designated SMTP client-ports. Port 25 is meant for server-to-server delivery, while users should use port 587 or 465. diff --git a/docs/kubernetes/mailu/index.rst b/docs/kubernetes/mailu/index.rst index 0f2451fa..0711abbd 100644 --- a/docs/kubernetes/mailu/index.rst +++ b/docs/kubernetes/mailu/index.rst @@ -128,7 +128,7 @@ And in the pod run the following command. The command uses following entries: .. code-block:: bash - python manage.py admin root example.com password + flask mailu admin root example.com password - ``admin`` Make it an admin user - ``root`` The first part of the e-mail adres (ROOT@example.com) @@ -207,4 +207,4 @@ If the login problem still persists, or more specific, happens now and then and kubectl -n mailu-mailserver get po kubectl -n mailu-mailserver delete po/mailu-imap... -Happy mailing! \ No newline at end of file +Happy mailing! diff --git a/optional/clamav/Dockerfile b/optional/clamav/Dockerfile index a4a889c7..27254544 100644 --- a/optional/clamav/Dockerfile +++ b/optional/clamav/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip \ + python3 py3-pip bash \ && pip3 install --upgrade pip # Image specific layers under this line RUN apk add --no-cache clamav rsyslog wget clamav-libunrar diff --git a/optional/postgresql/Dockerfile b/optional/postgresql/Dockerfile index 22409597..b03ff2d1 100644 --- a/optional/postgresql/Dockerfile +++ b/optional/postgresql/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip \ + python3 py3-pip bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install jinja2 diff --git a/optional/radicale/Dockerfile b/optional/radicale/Dockerfile index 4616d53d..de63daec 100644 --- a/optional/radicale/Dockerfile +++ b/optional/radicale/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:edge RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ - && apk add --no-cache radicale@testing py-dulwich@testing curl + && apk add --no-cache radicale@testing py-dulwich@testing curl bash COPY radicale.conf /radicale.conf diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..17d66169 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[tool.towncrier] + #package = "mypackage" + package_dir = "towncrier" + filename = "CHANGELOG.md" + underlines = ["-", "", ""] + template = "towncrier/template.md" + title_format = "v{version} - {project_date}" + issue_format = "[#{issue}](https://github.com/Mailu/Mailu/issues/{issue})" + start_string = "" diff --git a/services/fetchmail/Dockerfile b/services/fetchmail/Dockerfile index 52f794d5..8e4d5db0 100644 --- a/services/fetchmail/Dockerfile +++ b/services/fetchmail/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip \ + python3 py3-pip bash \ && pip3 install --upgrade pip # Image specific layers under this line RUN apk add --no-cache fetchmail ca-certificates \ diff --git a/services/rspamd/Dockerfile b/services/rspamd/Dockerfile index 32e93fac..70e6286d 100644 --- a/services/rspamd/Dockerfile +++ b/services/rspamd/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart diff --git a/services/unbound/Dockerfile b/services/unbound/Dockerfile index 9d40b691..325584fd 100644 --- a/services/unbound/Dockerfile +++ b/services/unbound/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.8 # python3 shared with most images RUN apk add --no-cache \ - python3 py3-pip git \ + python3 py3-pip git bash \ && pip3 install --upgrade pip # Shared layer between rspamd, postfix, dovecot, unbound and nginx RUN pip3 install git+https://github.com/usrpro/MailuStart.git#egg=mailustart diff --git a/setup/server.py b/setup/server.py index 4dfd49ae..0bb25a51 100644 --- a/setup/server.py +++ b/setup/server.py @@ -90,7 +90,10 @@ def build_app(path): def submit(): data = flask.request.form.copy() data['uid'] = str(uuid.uuid4()) - data['dns'] = str(ipaddress.IPv4Network(data['subnet'])[-2]) + try: + data['dns'] = str(ipaddress.IPv4Network(data['subnet'])[-2]) + except ValueError as err: + return "Error while generating files: " + str(err) db.set(data['uid'], json.dumps(data)) return flask.redirect(flask.url_for('.setup', uid=data['uid'])) diff --git a/towncrier/template.md b/towncrier/template.md new file mode 100644 index 00000000..07ccb4f6 --- /dev/null +++ b/towncrier/template.md @@ -0,0 +1,32 @@ +{% for section, _ in sections.items() %} +{% set underline = underlines[0] %}{% if section %}{{section}} +{{ underline * section|length }}{% set underline = underlines[1] %} + +{% endif %} + +{% if sections[section] %} +{% for category, val in definitions.items() if category in sections[section]%} +{{ definitions[category]['name'] }} +{{ underline * definitions[category]['name']|length }} +{% if definitions[category]['showcontent'] %} +{% for text, values in sections[section][category].items() %} +- {{ text }} ({{ values|join(', ') }}) +{% endfor %} + +{% else %} +- {{ sections[section][category]['']|join(', ') }} + +{% endif %} +{% if sections[section][category]|length == 0 %} +No significant changes. + +{% else %} +{% endif %} + +{% endfor %} +{% else %} +No significant changes. + + +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/webmails/rainloop/Dockerfile b/webmails/rainloop/Dockerfile index c20f1975..975227b0 100644 --- a/webmails/rainloop/Dockerfile +++ b/webmails/rainloop/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y \ COPY include.php /var/www/html/include.php COPY php.ini /php.ini -COPY config.ini /config.ini +COPY application.ini /application.ini COPY default.ini /default.ini COPY start.py /start.py diff --git a/webmails/rainloop/config.ini b/webmails/rainloop/application.ini similarity index 100% rename from webmails/rainloop/config.ini rename to webmails/rainloop/application.ini diff --git a/webmails/rainloop/include.php b/webmails/rainloop/include.php index 2376c683..fde91324 100644 --- a/webmails/rainloop/include.php +++ b/webmails/rainloop/include.php @@ -15,5 +15,5 @@ function __get_custom_data_full_path() */ function __get_additional_configuration_name() { - return 'config.ini'; + return 'application.ini'; } diff --git a/webmails/rainloop/start.py b/webmails/rainloop/start.py index 495eb376..8d369e47 100755 --- a/webmails/rainloop/start.py +++ b/webmails/rainloop/start.py @@ -20,7 +20,7 @@ os.makedirs(base + "domains", exist_ok=True) os.makedirs(base + "configs", exist_ok=True) convert("/default.ini", "/data/_data_/_default_/domains/default.ini") -convert("/config.ini", "/data/_data_/_default_/configs/config.ini") +convert("/application.ini", "/data/_data_/_default_/configs/application.ini") convert("/php.ini", "/usr/local/etc/php/conf.d/rainloop.ini") os.system("chown -R www-data:www-data /data")