Accessing Mastodon and the fediverse via email:
https://www.olowe.co/tmp/fedimail.mp4
An experimental #IMAP and #SMTP interface.
I feel like #NNTP #Usenet interface would be more appropriate.
But gotta start somewhere!
Threading and replies work ok too (so far!).
I love it! Half a year ago I wrote the beginnings of a Lemmy interface using IMAP, with the intention of using SMTP as a submission protocol, but the weirdness of IMAP kept causing issues for me, and I couldn’t figure out how to do paging and re-sorting based on Lemmy’s score.
I suppose those features aren’t necessarily relevant for a basic Fediverse server if you write it Mastodon style!
I got the basics working and even had different Lemmy communities show up as IMAP folders. Maybe I should revisit the project and force sorting by latest…
How are you planning on dealing with replies on other servers? Are you going to use fedifetcher (or a tool like that) or are you okay with missing half the replies?
Also, a suggestion you might consider: there’s a “chat” app called Deltachat that uses email as a backend (but looks like an app), maybe consider using that to allow secure messaging between your users?
@skullgiver Oh wow thanks! :) One program syncs my home Mastodon timeline, with all replies, to a Maildir. Dovecot serves that over IMAP. Sending involves a custom SMTP server which reads the mail message and creates a post from it.
For Mastodon it was all about converting statuses (toots? Posts?) into RFC 5322 messages. Using the status’ ID as
Message-Id
in the message header is handy. Mail clients do the heavy lifting of rendering threads thankfully!Ah, that’s probably a much more sensible approach. As weird as it may seem, I think your approach can actually produce a usable Mastodon client, whereas mine was kind of screwed from the start because the mail protocols don’t support paging.
I used the existing threading functionality too, but unfortunately I did something wrong and the threads would sometimes not appear or show up as separate messages despite (to my understanding) implementing message IDs right. I suspect it had something to do with IMAP clients getting confused by the ordering of messages (because Lemmy votes would shift messages around constantly).
How so you deal with mail clients quoting messages when responding to them? I hadn’t implemented receiving yet (through the libraries I used would’ve allows me to implement that in an hour or so) but I found it very difficult to strip out quotes from client submissions. Plaintext message content would offer relatively simple string replacing but would strip out the formatting (I intended to use HTML-to-markdown converters for that). I ended up undecided before constant bugs and weird behaviour made me abandon the attempt.
I also considered using NNTP, but that protocol is much more suited to this type of application, and where’s the fun in that!
I see that you’re using Acme over there… :)
Are you somewhat inspired by how Plan 9 handles e-mail? I was wondering if I could do the same but for 9front.
Ha good eyes! :) I have basic receive-only working with Lemmy using a virtual file system interface I wrote (https://pkg.go.dev/olowe.co/lemmy). Just realised we actually spoke about this a while ago haha (https://lemmy.sdf.org/post/1035382 )
But synchronising to disk is super inefficient: too many API calls. Should subscribe using ActivityPub proper and store updates received as RFC 5322 messages.
From there we could serve the messages via NNTP. Then, finally, we could use nntpfs(4)