HeyPuter / puter

🌐 The Internet OS! Free, Open-Source, and Self-Hostable.
https://puter.com
GNU Affero General Public License v3.0
24.55k stars 1.58k forks source link

Puter mail (self hosted local mailling) #581

Open Zac0511 opened 1 month ago

Zac0511 commented 1 month ago

I was (again) thinking of a feature for self hosted that would allow users to send mails across the local network to other users. They could send text and files across the local network, and this could work if 2 different users are logged at the same time, or if only one is logged. Received and sended mails by an user could be stored in a new .mail folder in the user's home folder. The folder could look like this in the inside (i put example usernames and UIDs) :

Filenames : Mail : mail-[year]-[month]-[day]-[hour & minutes].txt Attachment : [UID].[extension]

Example content from /[username]/.mail/received/joe3985/mail-2024-07-11-1016.txt :

[FROM: joe3985]
[TO: [username]]
[DATE: 2024 07 11 10:16]

[OBJECT: i love Puter]

[CONTENT:]
You know i really like **Puter**, here a screenshot i made in it : ![image](e74c5cd8-6deb-4329-911f-0b81d923ab3d)
I also got a little problem, so here's my log in case you can find the problem with it : ![file](fc0f6cb6-94f9-4bdb-8f16-d5a6ac73a33d)

The mails could support markdown, thats why i added "**".

This whole file would only be read by the mail app, and the information would then show in a clean way on the UI, like on Gmail, Outlook, etc...

When sending a mail, the user will see a list of all the users on the server, and can type an username if needed. In case someone (like admins if they exist with https://github.com/HeyPuter/puter/issues/580) don't want to be in the list, they can disappear from the list with a setting in the mail app, but they will still be able to receive mails by typing their username.

KernelDeimos commented 1 month ago

We've discussed this idea before actually. This will be a good intermediate feature before we implement some kind of instant messaging in Puter, or maybe something that could continue to exist alongside that.

One important consideration is you shouldn't be able to exhaust another users storage by sending them many/large messages. Instead the mail app can look for a shared directory from the other user.

Zac0511 commented 1 month ago

We've discussed this idea before actually. This will be a good intermediate feature before we implement some kind of instant messaging in Puter, or maybe something that could continue to exist alongside that.

One important consideration is you shouldn't be able to exhaust another users storage by sending them many/large messages. Instead the mail app can look for a shared directory from the other user.

Oh yeah. In that case, the folder directory could look like this :

And then, the mail app would be able to access the folder corresponding to the user's username, and display everything on the UI

secondtruth commented 1 month ago

Related: #337

jelveh commented 1 month ago

@Zac0511 we were also discussing (as did @secondtruth) how elegant the file-only approach is. We have a very fast filesystem that allows us to do this file-only approach.