1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Commit Graph

92 Commits

Author SHA1 Message Date
Florent Daigniere
ae9206e968 Implement a simple credential cache 2021-06-04 09:41:12 +02:00
Florent Daigniere
96ae54d04d CryptContext should be a singleton 2021-03-09 12:05:46 +01:00
Florent Daigniere
5f05fee8b3 Don't need regexps anymore 2021-03-09 12:05:46 +01:00
Florent Daigniere
1c5b58cba4 Remove scheme_dict 2021-03-09 12:05:46 +01:00
Florent Daigniere
fda758e2b4 remove merge artifact 2021-03-09 12:04:42 +01:00
Florent Daigniere
57a6abaf50 Remove {scheme} from the DB if mailu has set it 2021-03-09 12:04:42 +01:00
Florent Daigniere
7137ba6ff1 Misc improvements to PASSWORD_SCHEME
- remove PASSWORD_SCHEME altogether
- introduce CREDENTIAL_ROUNDS
- migrate all old hashes to the current format
- auto-detect/enable all hash types that passlib supports
- upgrade passlib to 1.7.4 (see #1706: ldap_salted_sha512 support)
2021-03-09 12:04:42 +01:00
Florent Daigniere
00b001f76b Improve the token storage format
shortcomings of the previous format included:
- 1000x slower than it should be (no point in adding rounds since there
 is enough entropy: they are not bruteforceable)
- vulnerable to DoS as explained in
https://passlib.readthedocs.io/en/stable/lib/passlib.hash.sha256_crypt.html#security-issues
2021-03-09 12:04:42 +01:00
Dario Ernst
da2dda49d4 Prefer specific alias over wildcard, regardless of case
Since direct addresses (not aliases) are case-insensitive since a while,
it makes sense for aliases to behave the same. Up until now, a wildcard
alias could trump a alias not-matching-the-case of the incoming address.
This clarifies this behavior.

closes #1387
2020-03-06 13:56:48 +01:00
Robert Meijers
989e4d5db5 Don't remove the address extension in postfix
Currently when the mail address is looked up by Postfix (using the admin
part) the address extension is removed. This is due to the address
extension being removed to look up the user, and afterwards returning
the users mail address. But by not returning the mail address including
the address extension it also isn't part anymore in the LMTP
communication to Dovecot. So Dovecot doesn't know about the extension,
and in turn the address extension can't be used in Sieve mail filtering.

This change fixes that by returning the original address by just
concatinating the "localpart" and domain again when the user is found.

Fixes #982
2019-12-27 21:11:50 +01:00
Dario Ernst
e22324adcd Make aliases case-insensitive (too)
Even though RFC5321 2.4 explains that local-parts are to be case-sensitive,
this does not seem to be how EMail is used today. Thus, instead of reverting
user-emails back to being case sensitive, let’s make aliases case-insensitive
too. Not only more consistent, this also allows users to enjoy receiving EMails
from large airlines or car-rental agencies onto their already existing aliases.

For the rare case of case sensitive aliases existing, let’s query for the
forced-lowercase alias only in the event that the preserved-case one isn’t
found …

closes #867
2019-04-14 12:02:12 +00:00
hoellen
6dea8b422a
Merge pull request #839 from hoellen/fix-create-onupdate-default
fix default value for created_at and updated_at
2019-01-16 12:11:13 +01:00
hoellen
9721df0bc5 fix default value for created_at and updated_at
Use date instead of datetime for created_at and updated_at.
2019-01-15 16:41:58 +01:00
hoellen
cfa7ca3838 Merge branch 'master' into schema-maxUserQuota-1 2019-01-15 16:22:54 +01:00
hoellen
2af540a1c9 change quota columns to bigint 2019-01-13 16:40:28 +01:00
Dario Ernst
66df7a31b0 Unify and coerce booleans from env used in admin
At some places, the string that DOMAIN_REGISTRATION is got used like a boolean
(an easy misassumption to make while in python and dealing with the config
dict), making `DOMAIN_REGISTRATION=False` act as a truthy value. To stop such
future problems from happening, coerce environment config strings to real
bools.

closes #830
2019-01-13 10:22:32 +01:00
mergify[bot]
9175b15d49
Merge pull request #826 from Nebukadneza/reverse_user_alias_pref
Reverse the resolution order of user and alias
2019-01-11 16:28:35 +00:00
mergify[bot]
278bcfb13a
Merge pull request #814 from Nebukadneza/fix_delimiter_alias
Deliver mails to alias-stripped-of-delimeter, even if catchall exists
2019-01-11 14:06:35 +00:00
Dario Ernst
276dc3ffda Reverse the resolution order of user and alias
Since it’s common for wildcard~ish systems to prefer concrete objects over
wildcards, and aliases can be broad-wildcards (think catchall, %@xxx.tld), it
may be more intuitive for users that user-names rank higher than aliases. This
makes it impossible for user-names to be unreachable, since they can be
completely overridden by a catchall otherwise.

This changes default behavior, and is not configurable.

closes #815
2019-01-11 11:51:56 +01:00
mergify[bot]
99cd1d714b
Merge pull request #799 from hoellen/fix-domain-negative-values-1
don't allow negative values on domain creation/edit
2019-01-11 09:57:15 +00:00
Tim Möhlmann
2567646f47
Merge branch 'master' into fix-domain-negative-values-1 2019-01-11 11:32:30 +02:00
Ionut Filip
50343f354e Merge remote-tracking branch 'upstream/master' into feat-psql-support 2019-01-11 11:21:22 +02:00
Dario Ernst
b8d1beed29 Simplify alias-wildcard detection to not consider actual % anymore 2019-01-10 23:06:56 +01:00
Dario Ernst
10d2601963 Unsimplify alias precedence handling
As discussed with hoellen on matrix, since postfix indeed supports including
the recipient delimiter character in a verbatim alias, we should support so too
— and handle its precedence correctly. The clearer and simpler formulation of
the precedence-clauses are credit to @hoellen. Thanks!
2019-01-10 17:30:11 +01:00
Dario Ernst
ac64a75743 Simplify alias precedence handling; Remove bogus changelog 2019-01-10 10:28:57 +01:00
Dario Ernst
291f8a457b Deliver mails to alias-stripped-of-delimeter, even if catchall exists
This fixes delivery to an alias minus recipient delimiter in cases where a
wildcard alias would also match. For example,
* foo@xxx.tld
* %@xxx.tld
Sending to foo+spam@xxx.tld would get eaten by the catchall before this fix.
Now, the order of alias resolution is made clearer.

closes #813
2019-01-09 11:41:22 +01:00
mergify[bot]
3b5f3af207
Merge pull request #778 from Nebukadneza/fix_recipient_delimiter
Attempt stripping recipient delimiter from localpart
2019-01-07 19:01:44 +00:00
Ionut Filip
9077bf7313 Merge remote-tracking branch 'upstream/master' into feat-psql-support 2019-01-07 16:29:50 +02:00
hoellen
dda64fe91e allow to disable aliases or users for domains and don't allow negativ values on domain creation/edit 2019-01-05 13:52:13 +01:00
Tim Möhlmann
b2823c23b8
Merge remote-tracking branch 'upstream/master' into feat-psql-support 2018-12-31 18:20:39 +02:00
TheLegend875
56f4d4c894 fixed auto-forward 2018-12-30 22:05:33 +01:00
Dario Ernst
c2d45a47fe Attempt stripping recipient delimiter from localpart
Since postfix now asks us for the complete email over podop, which
includes the recipient-delimiter-and-what-follows not stripped, we need
to attempt to find both the verbatim localpart, as well as the localpart
stripped of the delimited part ….

Fixes #755
2018-12-27 16:31:59 +01:00
kaiyou
7e388e472a Handle relay name as an Idna domain 2018-12-10 15:16:30 +01:00
kaiyou
b8282b1d46 Support named constraints for multiple backends
Supporting multiple backends requires that specific sqlite
collations are not used, thus lowercase is applied to all non
case-sensitive columns. However, lowercasing the database requires
temporary disabling foreign key constraints, which is not possible
on SQLite and requires we specify the constraint names.

This migration specific to sqlite and postgresql drops every
constraint, whether it is named or not, and recreates all of them
with known names so we can later disable them.
2018-12-10 15:16:30 +01:00
kaiyou
e022513a94 Fix support for postgres and mysql 2018-12-10 15:16:30 +01:00
kaiyou
a881a1a839 Revert "Make current migrations work with postgresql"
This reverts commit 9b9f3731f6.
2018-12-10 15:03:12 +01:00
kaiyou
76925e82f3 Revert "Implement CIText as NOCASE alternative in postgresql"
This reverts commit 0f3c1b9d15.
2018-12-10 15:01:27 +01:00
kaiyou
f52ae5535c Revert "Created function for returning email type"
This reverts commit 436055f02c.
2018-12-10 14:58:18 +01:00
kaiyou
f6520eace6 Merge branch 'feat-psql-support' of https://github.com/usrpro/Mailu into usrpro-feat-psql-support 2018-12-10 14:50:38 +01:00
hoellen
8fe9e695f3 prefer non-wildcard aliases over wildcard aliases 2018-12-10 08:40:10 +01:00
hoellen
79768c09f6 fix alias matching behaviour 2018-12-09 19:49:23 +01:00
kaiyou
b6aaf57be1 Merge branch 'refactor-config' of github.com:kaiyou/mailu into refactor-config 2018-12-06 10:33:21 +01:00
kaiyou
d0f07984b0 Merge remote-tracking branch 'upstream/master' into refactor-config 2018-12-06 10:23:43 +01:00
mergify[bot]
37027cfce7
Merge pull request #633 from kaiyou/fix-sender-checks
Improve sender checks
2018-12-05 16:03:24 +00:00
Tim Möhlmann
c9df311a0d
Set forward_destination to an empty list
The value of `None` resulted in an error, since a list was expected.
2018-12-04 16:22:18 +02:00
Ionut Filip
436055f02c Created function for returning email type 2018-11-21 13:43:06 +01:00
Tim Möhlmann
0f3c1b9d15
Implement CIText as NOCASE alternative in postgresql 2018-11-20 14:41:17 +02:00
Tim Möhlmann
9b9f3731f6
Make current migrations work with postgresql 2018-11-19 19:10:38 +02:00
Tim Möhlmann
4783e61693
Fix password context
Fixes the following error:
```
admin_1      | [2018-11-09 09:44:10,533] ERROR in app: Exception on /internal/auth/email [GET]
admin_1      | Traceback (most recent call last):
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
admin_1      |     response = self.full_dispatch_request()
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
admin_1      |     rv = self.handle_user_exception(e)
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
admin_1      |     reraise(exc_type, exc_value, tb)
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
admin_1      |     raise value
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
admin_1      |     rv = self.dispatch_request()
admin_1      |   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
admin_1      |     return self.view_functions[rule.endpoint](**req.view_args)
admin_1      |   File "/usr/lib/python3.6/site-packages/flask_limiter/extension.py", line 544, in __inner
admin_1      |     return obj(*a, **k)
admin_1      |   File "/app/mailu/internal/views/auth.py", line 18, in nginx_authentication
admin_1      |     headers = nginx.handle_authentication(flask.request.headers)
admin_1      |   File "/app/mailu/internal/nginx.py", line 48, in handle_authentication
admin_1      |     if user.check_password(password):
admin_1      |   File "/app/mailu/models.py", line 333, in check_password
admin_1      |     context = User.pw_context
admin_1      | AttributeError: type object 'User' has no attribute 'pw_context'
```
2018-11-09 11:45:08 +02:00
kaiyou
5b769e23da Merge branch 'master' into refactor-config 2018-11-08 21:43:05 +01:00