this post was submitted on 21 Jul 2023
2374 points (98.6% liked)

Lemmy.World Announcements

28968 readers
4 users here now

This Community is intended for posts about the Lemmy.world server by the admins.

Follow us for server news 🐘

Outages πŸ”₯

https://status.lemmy.world

For support with issues at Lemmy.world, go to the Lemmy.world Support community.

Support e-mail

Any support requests are best sent to info@lemmy.world e-mail.

Report contact

Donations πŸ’—

If you would like to make a donation to support the cost of running this platform, please do so at the following donation URLs.

If you can, please use / switch to Ko-Fi, it has the lowest fees for us

Ko-Fi (Donate)

Bunq (Donate)

Open Collective backers and sponsors

Patreon

Join the team

founded 1 year ago
MODERATORS
 

As requested by some users: 'old' style now accessible via https://old.lemmy.world

Code can be found here: https://github.com/rystaf/mlmym , created by Ryan (Is he here?) (Yes he appears to be! @nnrx@sh.itjust.works ! Thanks for this awesome front-end!)

you are viewing a single comment's thread
view the rest of the comments
[–] skullgiver@popplesburger.hilciferous.nl 33 points 1 year ago (4 children)

This gives me the terrible, terrible idea of an IMAP+SMTP frontend for Lemmy.

I can't think of a technical argument why it wouldn't work, despite how cursed the concept of using Lemmy through Outlook Express sounds.

[–] Hobo@lzrprt.sbs 15 points 1 year ago

I need to see this now lol. Let's get freaky with Lemmy frontends.

[–] WeirdAlex03@lemmy.zip 3 points 1 year ago

I hate how much I actually want to try this

[–] mercano@lemmy.world 1 points 1 year ago (1 children)

An NNTP binding would be a bit more directly mappable, as Lemmy’s more analogous to Usenet than email. Each community would be a newsgroup. Still, NNTP and SMTP are pretty closely related, to the point that Outlook Express supported both email and Usenet. Subscribing, reading, posting, and commenting are pretty easy concepts to map, only up and downvoting are unsupported.

This is the result of a weekend teaching myself Go, using go-imap:

I can actually receive DMs in Outlook Express now! That and listing posts in a community sorted by date are about all it does, but it works!

I went with IMAP because IMAP has more open source server code. It doesn't matter much, modern IMAP actually has native threading support for example. I've modeled Lemmy as every community being a mailbox under INBOX (with INBOX being reserved for DMs). My idea was to use the flags for upvoting/downvoting (you can add arbitrary flags to IMAP, although I seem to be the only person using them). Favorites are easy (just use the marking/star/flag/whatever feature).

Subscriptions are already part of IMAP. I implemented them but I disabled them when Outlook Express tried to "reset to defaults" and almost unsubbed me from every community.

Admin stuff is also possible, technically! Removing folders would be the same as purging them (rather than unsubbing), deleting emails would be like deleting posts. Add a CardDAV server and you may even do user management!

I even came up with a scheme to do sorting (INBOX/topday/community@server.example). This is a horrible hack, but Gmail does something similar, duplicating messages across labels.

The experience taught me a lot about IMAP and I hate the protocol now. What the hell is up with message IDs changing every time the client contacts the server?

The problem with either protocol is that server-side sorting is barely implemented. Messages are cached by the client so things like scoring are impossible to implement right. Another issue is the lack of pagination, but I guess that can be solved by an arbitrary cut-off date or a limited amount of posts.

I'd also need to think of a way to fetch all replies to make the email threads work. Right now it only lists posts, it doesn't fetch comments yet.

SMTP as an input mechanism shouldn't even be that bad (as long as you make sure the reply button replies to a unique "email address" like post12345@server.example). My plan was to parse everything as Markdown (after extracting the text from HTML emails). Image attachments would be a bit harder, but I think they could work.

I think I should re-do the entire thing using direct database access rather than using the Lemmy API, because right now refreshing all folders downloads all messages on the server which quickly kills the server/hits the request limit. Maybe I'll eventually come back to this, but developing and debugging this is rather slow and painful.