๐Ÿ’พ Archived View for bbs.geminispace.org โ€บ u โ€บ clseibold โ€บ 5649 captured on 2023-09-28 at 16:54:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

โžก๏ธ Next capture (2023-11-04)

-=-=-=-=-=-=-

Re: "Misfin Server Ideas"

Comment in: s/misfin

@billsmugs Having multiple files for emails is fine if you want to have to manage naming all of those files and putting them in their own directories for each user and then keeping track of the file names, but I feel having a single file is simpler and does not make the parser that much more complicated (it added few lines of code). I personally don't think gembox is that complicated, but you're right that the divider needs to be something that won't appear in regular messages.

The sender and timestamp, afaik, are not guaranteed to be the first two lines, because you can have multiple senders if you are receiving a forwarded message, and you can have multiple timestamps based on how many times a user has received that message, as per the spec.

๐Ÿš€ clseibold

2023-09-27 ยท 1 day ago

8 Later Comments โ†“

๐Ÿš€ clseibold

@billsmugs I wanted to also mention that the divider I chose for gemboxes is the exact string `<=====\n`. The `<` means that it could be conflated with a Sender line, which is a good thing because then readers that don't support gemboxes will either error out on an invalid address syntax, or they will just ignore this invalid line. But for readers that support gembox, they can easily split the file based on these and then handle each gemmail separately. Using the `<` *because* it was already a gemmail linetype was intentional for these reasons.

So the big question is how do we escape the gemmail linetype specifiers (`<`, `@` and `:` at the start of a line).

๐Ÿ“ท billsmugs

Using the '<' as the start of the divider is a clever solution, but I'm still not sure what the gembox format gains you in exchange for the effort? I don't keep track of any file names for messages, they have the received date/time at the start of the file name to quickly sort them but when a user requests their inbox page the server just works off the list of all files in the mailbox directory.

Having a single flat file per user does make migrating to another server easier I suppose (the user can just grab all of their messages in one go and theoretically import them into another server/client), but I'm not sure that's worth having to split the file up programatically each time the user views their inbox?

In order to display a message listing, you only need to know the address you received the message from and the date/time it was received, which will always be the first two lines of the file I think? (Other instances of <,: and @ inside the message from forwards/replies etc could be handled by a client to render them differently, but they don't need to be parsed to display an inbox).

๐Ÿš€ clseibold

In order to display a message listing, you only need to know the address you received the message from and the date/time it was received, which will always be the first two lines of the file I think? (Other instances of <,: and @ inside the message from forwards/replies etc could be handled by a client to render them differently, but they don't need to be parsed to display an inbox).

I don't think this is true. What I get from the examples in the spec is that the latest sender is always the last sender line, not the first. Same with timestamps. The latest timestamp is the last timestamp, not the first.

Although, it depends on if you are talking about the original sender or the person who forwarded the email to you, I suppose.

This makes sense to me because the lines are always in the order, from earliest/first to latest/last. The first sender is the first sender line, whereas the last sender is the last sender line.

You are also not guaranteed to get the timestamp within the first two lines. My current server appends timestamps after all sender lines, for example. If I wanted to switch this, then I would need to refactor my parser a bit.

As for the gembox format, it was modelled after the mbox format. mbox dates well back to Multics, probably even CTSS, well before Unix v1. I assume they chose the mbox format because it was simple to set permissions, it was just one file that had to be read, and it was fairly easy to parse, and one could move messages from/to different mbox files. It's also easier to transport mbox files. These are pretty much all of the reasons I chose to do gembox as well.

Gembox is certainly an optional thing. Servers don't need to support appending to gemboxes, so I think it's good that there are different ways of storing messages for different servers.

As for readers, supporting both individual gemmails and gemboxes allows for servers to pick and choose which they find best for their setup without worrying about hvaing unsupported readers. These two options, individual gemmails, and a flat file format like gembox, pretty much support all the options that one could need for mail storage, imo.

๐Ÿš€ clseibold

@billsmugs I still think you're overestimating the effort it took me to make a gembox parser. It took like 2 minutes to make, lol. I mostly just wrap around my already-make gemmail parser, detect `<=====` to split stuff, and then pass each split piece to the gemmail parser. You could probably even do what I did in even less time and with even less effort by using strings.Split in golang.

Although, you do have a point in splitting up a file each time the inbox is opened. If the gembox file ends up having like thousands of gemmails in it, then I could see how this might make it slow, but modern computers are pretty darn fast, so I'd have to test to see how slow it actually would be for big files like this.

๐Ÿฆ€ jeang3nie

re binary data, the spec is pretty clear that's a non starter and you should just send a link to a file.

One could always work around that restriction using base32 or base64 encoding, however.

22 hours ago

๐Ÿ“ท billsmugs

@clseibold Having read my own messages back, I'm worried I've come across as antagonistic and/or dismissive about the gembox format, which wasn't my intention! The ease of transferring/backing up entire mailboxes and setting file permissions are definitely advantages of your system over mine that hadn't occurred to me (UNIX permissions are something I keep meaning to do more reading about in general as I know they are quite powerful but have very little knowledge of how they work and what they can do) and you're probably right that the performance impact is negligible in reality.

With regards to forwarding and sender line ordering, if Alice sends a message to Bob's server, which auto-forwards it on to me, I would expect to see the message in my inbox start with the following, with my server adding the first two lines and Bob's server adding the last two:

< b@b.com Bob
@ 2023-09-27T00:00:01
< a@a.com Alice
@ 2023-09-27T00:00:00

The example in the spec for sender lines omits timestamps but looks like it matches this order:

< development@mailing-lists.com Development mailing list
< source@example.com Source user

I understood this as Source user sending a message to the mailing list and I then receive a message from the mailing list address.

21 hours ago

๐Ÿš€ clseibold

@billsmugs I didn't read it as antagonistic, so don't worry about that :)

Also, you're absolutely correct and I misread the spec. I will have to change my server code to prepend rather than append. This is a simple change.

The thing I still have a question about is if timestamps are grouped together in reverse order like the senders are, or if the sender lines and timestamp lines are intermingled, like so:

@ Final Destination Timestamp

< Mailinglist

@ Mailinglist Timestamp

< Source user

Of if it's supposed to be more like the following:

< Mailinglist

< Source user

@ FInal Destination Timestamp

@ Mailinglist Timestamp

If it's the first one, then I will have to make major changes to my parser, because currently my parser does the second option.

Personally, I don't like that the senders are in reverse order. I feel the source user should always be at the top, not as the last sender line. For mailinglists, you want the source user as the real sender, but for forwarding emails, you want the last sender (the forwarder) as the real sender, I suppose. Hm....

๐Ÿ˜บ gemalaya

In the python implementation i wrote a gembox folder class that uses the MH mailbox format. Honestly it's much nicer because you don't have to deal with indexes and stuff.

6 hours ago

Original Post

๐ŸŒ’ s/misfin

Misfin Server Ideas โ€” I believe I have written a basic solo-mailbox server in golang. It is running now, so people should be able to test it at my same misfin address (clseibold@auragem.letz.dev). I wanted to outline some ideas that I have for the server: 1. I want it to support both solo-mailbox and multi-mailbox setups. 2. An interesting idea came up when I compared the spec to gemini. Gemini has this proxy ability, I believe, so that it could actually proxy other gemini servers. This led...

๐Ÿ’ฌ clseibold ยท 18 comments ยท 1 like ยท 2023-09-27 ยท 2 days ago