You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Merge #2007
2007: allow sending emails as user+detail@domain.tld r=mergify[bot] a=ghostwheel42 ## What type of PR? bug-fix or enhancement ## What does this PR do? Allows sending emails with an added "+detail" in the local part. ### Related issue(s) closes #1948 ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. 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 - [X] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com> Co-authored-by: root <ghostwheel42@users.noreply.github.com> Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
This commit is contained in:
@@ -49,6 +49,7 @@ DEFAULT_CONFIG = {
|
||||
'DKIM_PATH': '/dkim/{domain}.{selector}.key',
|
||||
'DEFAULT_QUOTA': 1000000000,
|
||||
'MESSAGE_RATELIMIT': '200/day',
|
||||
'RECIPIENT_DELIMITER': '',
|
||||
# Web settings
|
||||
'SITENAME': 'Mailu',
|
||||
'WEBSITE': 'https://mailu.io',
|
||||
|
||||
@@ -140,6 +140,7 @@ def postfix_sender_login(sender):
|
||||
localpart, domain_name = models.Email.resolve_domain(sender)
|
||||
if localpart is None:
|
||||
return flask.jsonify(",".join(wildcard_senders)) if wildcard_senders else flask.abort(404)
|
||||
localpart = localpart[:next((i for i, ch in enumerate(localpart) if ch in flask.current_app.config.get('RECIPIENT_DELIMITER')), None)]
|
||||
destination = models.Email.resolve_destination(localpart, domain_name, True)
|
||||
destination = [*destination, *wildcard_senders] if destination else [*wildcard_senders]
|
||||
return flask.jsonify(",".join(destination)) if destination else flask.abort(404)
|
||||
|
||||
@@ -93,9 +93,10 @@ go and fetch new email if available. Do not use too short delays if you do not
|
||||
want to be blacklisted by external services, but not too long delays if you
|
||||
want to receive your email in time.
|
||||
|
||||
The ``RECIPIENT_DELIMITER`` is a character used to delimit localpart from a
|
||||
custom address part. For instance, if set to ``+``, users can use addresses
|
||||
like ``localpart+custom@domain.tld`` to deliver mail to ``localpart@domain.tld``.
|
||||
The ``RECIPIENT_DELIMITER`` is a list of characters used to delimit localpart
|
||||
from a custom address part. For instance, if set to ``+-``, users can use
|
||||
addresses like ``localpart+custom@example.com`` or ``localpart-custom@example.com``
|
||||
to deliver mail to ``localpart@example.com``.
|
||||
This is useful to provide external parties with different email addresses and
|
||||
later classify incoming mail based on the custom part.
|
||||
|
||||
|
||||
1
towncrier/newsfragments/2007.enhancement
Normal file
1
towncrier/newsfragments/2007.enhancement
Normal file
@@ -0,0 +1 @@
|
||||
allow sending emails as user+detail@domain.tld
|
||||
Reference in New Issue
Block a user