We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Alternatives useless after podop
After updating to master to get all the up-to-date fixes it also moves postfix to use podop and it seems to no longer support receiving external mail from alternative domains 😢 

Sending internal mail between alternatives works as expected but not with external mail, a "relay denied" message is shown in the logs and when checking the postfix podop views it looks like alternative is never mentioned.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/admin/mailu/internal/views/postfix.py`
Content:
```
1 from mailu import db, models
2 from mailu.internal import internal
3 
4 import flask
5 
6 
7 @internal.route("/postfix/domain/<domain_name>")
8 def postfix_mailbox_domain(domain_name):
9     domain = models.Domain.query.get(domain_name) or flask.abort(404)
10     return flask.jsonify(domain.name)
11 
12 
13 @internal.route("/postfix/mailbox/<email>")
14 def postfix_mailbox_map(email):
15     user = models.User.query.get(email) or flask.abort(404)
16     return flask.jsonify(user.email)
17 
18 
19 @internal.route("/postfix/alias/<alias>")
20 def postfix_alias_map(alias):
21     localpart, domain = alias.split('@', 1) if '@' in alias else (None, alias)
22     alternative = models.Alternative.query.get(domain)
23     if alternative:
24         domain = alternative.domain_name
25     email = '{}@{}'.format(localpart, domain)
26     if localpart is None:
27         return flask.jsonify(domain)
28     else:
29         alias_obj = models.Alias.resolve(localpart, domain)
30         if alias_obj:
31             return flask.jsonify(",".join(alias_obj.destination))
32         user_obj = models.User.query.get(email)
33         if user_obj:
34             return flask.jsonify(user_obj.destination)
35         return flask.abort(404)
36 
37 
38 @internal.route("/postfix/transport/<email>")
39 def postfix_transport(email):
40     localpart, domain = email.split('@', 1) if '@' in email else (None, email)
41     relay = models.Relay.query.get(domain) or flask.abort(404)
42     return flask.jsonify("smtp:[{}]".format(relay.smtp))
43 
44 
45 @internal.route("/postfix/sender/<sender>")
46 def postfix_sender(sender):
47     """ Simply reject any sender that pretends to be from a local domain
48     """
49     localpart, domain_name = sender.split('@', 1) if '@' in sender else (None, sender)
50     domain = models.Domain.query.get(domain_name)
51     alternative = models.Alternative.query.get(domain_name)
52     if domain or alternative:
53         return flask.jsonify("REJECT")
54     return flask.abort(404)
55
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py
--- a/core/admin/mailu/internal/views/postfix.py
+++ b/core/admin/mailu/internal/views/postfix.py
@@ -6,7 +6,9 @@
 
 @internal.route("/postfix/domain/<domain_name>")
 def postfix_mailbox_domain(domain_name):
-    domain = models.Domain.query.get(domain_name) or flask.abort(404)
+    domain = models.Domain.query.get(domain_name) or \
+             models.Alternative.query.get(domain_name) or \
+             flask.abort(404)
     return flask.jsonify(domain.name)

{"golden_diff": "diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py\n--- a/core/admin/mailu/internal/views/postfix.py\n+++ b/core/admin/mailu/internal/views/postfix.py\n@@ -6,7 +6,9 @@\n \n @internal.route(\"/postfix/domain/<domain_name>\")\n def postfix_mailbox_domain(domain_name):\n-    domain = models.Domain.query.get(domain_name) or flask.abort(404)\n+    domain = models.Domain.query.get(domain_name) or \\\n+             models.Alternative.query.get(domain_name) or \\\n+             flask.abort(404)\n     return flask.jsonify(domain.name)\n", "issue": "Alternatives useless after podop\nAfter updating to master to get all the up-to-date fixes it also moves postfix to use podop and it seems to no longer support receiving external mail from alternative domains \ud83d\ude22 \r\n\r\nSending internal mail between alternatives works as expected but not with external mail, a \"relay denied\" message is shown in the logs and when checking the postfix podop views it looks like alternative is never mentioned.\n", "before_files": [{"content": "from mailu import db, models\nfrom mailu.internal import internal\n\nimport flask\n\n\n@internal.route(\"/postfix/domain/<domain_name>\")\ndef postfix_mailbox_domain(domain_name):\n    domain = models.Domain.query.get(domain_name) or flask.abort(404)\n    return flask.jsonify(domain.name)\n\n\n@internal.route(\"/postfix/mailbox/<email>\")\ndef postfix_mailbox_map(email):\n    user = models.User.query.get(email) or flask.abort(404)\n    return flask.jsonify(user.email)\n\n\n@internal.route(\"/postfix/alias/<alias>\")\ndef postfix_alias_map(alias):\n    localpart, domain = alias.split('@', 1) if '@' in alias else (None, alias)\n    alternative = models.Alternative.query.get(domain)\n    if alternative:\n        domain = alternative.domain_name\n    email = '{}@{}'.format(localpart, domain)\n    if localpart is None:\n        return flask.jsonify(domain)\n    else:\n        alias_obj = models.Alias.resolve(localpart, domain)\n        if alias_obj:\n            return flask.jsonify(\",\".join(alias_obj.destination))\n        user_obj = models.User.query.get(email)\n        if user_obj:\n            return flask.jsonify(user_obj.destination)\n        return flask.abort(404)\n\n\n@internal.route(\"/postfix/transport/<email>\")\ndef postfix_transport(email):\n    localpart, domain = email.split('@', 1) if '@' in email else (None, email)\n    relay = models.Relay.query.get(domain) or flask.abort(404)\n    return flask.jsonify(\"smtp:[{}]\".format(relay.smtp))\n\n\n@internal.route(\"/postfix/sender/<sender>\")\ndef postfix_sender(sender):\n    \"\"\" Simply reject any sender that pretends to be from a local domain\n    \"\"\"\n    localpart, domain_name = sender.split('@', 1) if '@' in sender else (None, sender)\n    domain = models.Domain.query.get(domain_name)\n    alternative = models.Alternative.query.get(domain_name)\n    if domain or alternative:\n        return flask.jsonify(\"REJECT\")\n    return flask.abort(404)\n", "path": "core/admin/mailu/internal/views/postfix.py"}], "after_files": [{"content": "from mailu import db, models\nfrom mailu.internal import internal\n\nimport flask\n\n\n@internal.route(\"/postfix/domain/<domain_name>\")\ndef postfix_mailbox_domain(domain_name):\n    domain = models.Domain.query.get(domain_name) or \\\n             models.Alternative.query.get(domain_name) or \\\n             flask.abort(404)\n    return flask.jsonify(domain.name)\n\n\n@internal.route(\"/postfix/mailbox/<email>\")\ndef postfix_mailbox_map(email):\n    user = models.User.query.get(email) or flask.abort(404)\n    return flask.jsonify(user.email)\n\n\n@internal.route(\"/postfix/alias/<alias>\")\ndef postfix_alias_map(alias):\n    localpart, domain = alias.split('@', 1) if '@' in alias else (None, alias)\n    alternative = models.Alternative.query.get(domain)\n    if alternative:\n        domain = alternative.domain_name\n    email = '{}@{}'.format(localpart, domain)\n    if localpart is None:\n        return flask.jsonify(domain)\n    else:\n        alias_obj = models.Alias.resolve(localpart, domain)\n        if alias_obj:\n            return flask.jsonify(\",\".join(alias_obj.destination))\n        user_obj = models.User.query.get(email)\n        if user_obj:\n            return flask.jsonify(user_obj.destination)\n        return flask.abort(404)\n\n\n@internal.route(\"/postfix/transport/<email>\")\ndef postfix_transport(email):\n    localpart, domain = email.split('@', 1) if '@' in email else (None, email)\n    relay = models.Relay.query.get(domain) or flask.abort(404)\n    return flask.jsonify(\"smtp:[{}]\".format(relay.smtp))\n\n\n@internal.route(\"/postfix/sender/<sender>\")\ndef postfix_sender(sender):\n    \"\"\" Simply reject any sender that pretends to be from a local domain\n    \"\"\"\n    localpart, domain_name = sender.split('@', 1) if '@' in sender else (None, sender)\n    domain = models.Domain.query.get(domain_name)\n    alternative = models.Alternative.query.get(domain_name)\n    if domain or alternative:\n        return flask.jsonify(\"REJECT\")\n    return flask.abort(404)\n", "path": "core/admin/mailu/internal/views/postfix.py"}]}