mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.56k stars 99 forks source link

Regarding the webmail and UI #97

Closed naddika closed 10 months ago

naddika commented 10 months ago

I like UI for "admin" and "webmail" at its present form - so simple and light, yet it does its job well. But it's still built with some UI framework, right? What is it? Where's the UI part in the repo?

Also, there's no "logout" button? It's needed when I need to switch between a real mailbox and "catchall" one.

mjl- commented 10 months ago

For the logout button, see issue #58. It's on the to do list.

The admin page is at https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webadmin/admin.html. It starts with a little bit of framework, then some common functions, followed by a function per page, and finally the routing at the bottom. I'm planning to change the JS in the admin.html over the typescript. The structure will be the same, just types added and a bit of refactoring due to that.

The webmail starts at https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webmail/webmail.html, most of it is at https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webmail/webmail.ts, with the same basic inline framework as for the admin pages, the api to the backend is generated into https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webmail/api.json, which is generated into https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webmail/api.ts. https://github.com/mjl-/mox/blob/651fa6806737cda818c708bcb2eb3b133fca0165/webmail/lib.ts has functions the main webmail code shared with msg.ts, which is for displaying just one message.

The webadmin, webaccount and webmail talk to the backend through api calls, defined in webadmin/admin.go, webaccount/account.go, webmail/api.go.

naddika commented 10 months ago

I see.

For now there's no way to concolidate a mailbox "a1" with "catchall" one, right? One has to log in the two separately.

mjl- commented 10 months ago

A "mailbox" is a directory holding messages, for example "Inbox" or "Trash". So you probably either mean address or account.

If it is a single account with both a fully specified and a catchall address, you should be able to use it with a single login session. The logins are per account, accepting any valid email address (for the webmail, the address you login with is the email address used when composing a new message, though perhaps not if it only matches a catchall address). In the webmail, when composing, you can compose a message with a custom From address by clicking the From button. (If it doesn't actually work, we can fix it). Sending can only be done with addresses that match a specific or catchall address.

If "a1" and the "catchall" address are in different accounts, you cannot use them for a single login.

naddika commented 10 months ago

Also, in "webmail" there's no way to see who I am logged in as?

One can click "compose" and see a list of accounts in "From" dropdown -- this will be one way. Although this still won't reveal whether or not one is a "catchall" account.