• Oliver Lowe@hachyderm.ioOP
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    @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!

    • Skull giver@popplesburger.hilciferous.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 months ago

      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!