mox/webmail
Mechiel Lukkien 614576e409
improve http request handling for internal services and multiple domains
per listener, you could enable the admin/account/webmail/webapi handlers. but
that would serve those services on their configured paths (/admin/, /,
/webmail/, /webapi/) on all domains mox would be webserving, including any
non-mail domains. so your www.example/admin/ would be serving the admin web
interface, with no way to disabled that.

with this change, the admin interface is only served on requests to (based on
Host header):
- ip addresses
- the listener host name (explicitly configured in the listener, with fallback
  to global hostname)
- "localhost" (for ssh tunnel/forwarding scenario's)

the account/webmail/webapi interfaces are served on the same domains as the
admin interface, and additionally:
- the client settings domains, as optionally configured in each Domain in
  domains.conf. typically "mail.<yourdomain>".

this means the internal services are no longer served on other domains
configured in the webserver, e.g. www.example.org/admin/ will not be handled
specially.

the order of evaluation of routes/services is also changed:
before this change, the internal handlers would always be evaluated first.
with this change, only the system handlers for
MTA-STS/autoconfig/ACME-validation will be evaluated first. then the webserver
handlers. and finally the internal services (admin/account/webmail/webapi).
this allows an admin to configure overrides for some of the domains (per
hostname-matching rules explained above) that would normally serve these
services.

webserver handlers can now be configured that pass the request to an internal
service: in addition to the existing static/redirect/forward config options,
there is now an "internal" config option, naming the service
(admin/account/webmail/webapi) for handling the request. this allows enabling
the internal services on custom domains.

for issue #160 by TragicLifeHu, thanks for reporting!
2024-05-11 11:13:14 +02:00
..
api.go use shorter smtp.NewAddress() instead of smtp.Address{...} 2024-05-09 21:26:22 +02:00
api.json webmail: when moving a single message out of/to the inbox, ask if user wants to create a rule to automatically do that server-side for future deliveries 2024-04-21 17:14:08 +02:00
api.ts webmail: when moving a single message out of/to the inbox, ask if user wants to create a rule to automatically do that server-side for future deliveries 2024-04-21 17:14:08 +02:00
api_test.go add debug logging about bstore db schema upgrades 2024-05-10 14:44:37 +02:00
eventwriter.go replace packages slog and slices from golang.org/x/exp with stdlib 2024-02-08 14:49:01 +01:00
lib.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
message.go webmail: remember per from-address whether we should show the text/html/html-with-external-resources version of a message 2024-04-20 21:25:52 +02:00
message_test.go webmail: recognize multiple urls in List-Post addresses 2024-04-16 20:26:37 +02:00
msg.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
msg.js webmail: when opening message in new tab, set document title to subject, message from address(es) and id of message 2024-05-09 21:19:58 +02:00
msg.ts webmail: when opening message in new tab, set document title to subject, message from address(es) and id of message 2024-05-09 21:19:58 +02:00
text.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
text.js webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
text.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
view.go add aliases/lists: when sending to an alias, the message gets delivered to all members 2024-04-24 19:15:30 +02:00
view_test.go webmail: less boilerplate code for api functions 2024-04-21 21:32:24 +02:00
webmail.go improve http request handling for internal services and multiple domains 2024-05-11 11:13:14 +02:00
webmail.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
webmail.js webmail: in list of From address to use in compose window, don't add the catchall address 2024-05-09 20:55:03 +02:00
webmail.ts webmail: in list of From address to use in compose window, don't add the catchall address 2024-05-09 20:55:03 +02:00
webmail_test.go webmail: add export functionality 2024-04-22 13:41:40 +02:00