Skip to content

Commit

Permalink
Updated docs, and 1.0 wooo
Browse files Browse the repository at this point in the history
  • Loading branch information
miakizz committed May 8, 2023
1 parent a76f68a commit 9a75204
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mop3"
version = "0.1.1"
version = "1.0.0"
edition = "2021"
authors = ["Nathan Kiesman <[email protected]>"]
license = "MIT"
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# MOP3
A Mastodon to POP3 Gateway
A Mastodon to email client Gateway

MOP3 is a toy-ish, standard complient-ish server which speaks POP3, and serves data from your home Mastodon timeline. This enables email clients made as early as the 1980s to receive and display Mastodon posts. MOP3 is intended less for everyday use, and more for retro-computing, as it can be difficult to setup an email server to play with old clients, and modern email servers want silly things like security. With that said, it could be used as a true Mastodon client, as even modern email clients like Apple's Mail.app support POP3. Emails are served in plain-text with the HTML stripped, and optionally, with all Unicode converted to 7 bit ASCII. Currently it does support threading and image URLs; future additions could include TLS/SSL support, inline HTML, and even posting via SMTP.
<img src="screenshots/mop3-win.png" alt="Outlook Express displaying Mastodon posts" width="800"/>
MOP3 is a toy-ish, standards complient-ish server that speaks POP3/SMTP which serves data from your home Mastodon timeline. This enables email clients from as early as the 1980s and as recent as today to receive, send, and reply to Mastodon posts (including images). This was started as a retro-computing project, however I've used it as my main client during development, as even modern email clients like Apple's Mail.app and Windows Mail support POP3 and SMTP. MOP3 can be configured to encode posts in Unicode or ASCII, with or without HTML, and images either as links, or attachments.

<img src="screenshots/mop3-win.png" alt="Outlook Express displaying Mastodon posts" width="500"/>
<img src="screenshots/mop3-linux.png" alt="Sylpheed on Linux" width="500"/>

## Installation
This is written in Rust, so running `cargo install mop3` on your host should install it. If not, downloading the repo and running `cargo build` should also work. Binaries can be provided if desired, just drop me a line.
Binaries are available for Windows, Mac, and Linux on the releases page. This is written in Rust, so running `cargo install mop3` on your host should install it. If not, downloading the repo and running `cargo build` should also work.

## Usage
This requires an access token, which can be obtained in Preferences -> Development -> New Application on your Mastodon instance. MOP3 only requires read permissions, so I reccomend not giving it any of the other ones. The client key and secret are not required.
This requires an access token, which can be obtained in Preferences -> Development -> New Application on your Mastodon account. The client key and secret are _not_ required.

`mop3 --help` will give you all of the important runtime flags, none of which are required, but `--token` can be especially useful if you don't want to type in your access token on your retro machine. By default the server binds to localhost, port 110. To enable connections from other clients, pass the option `--address 0.0.0.0:110`.
`mop3 --help` will give you all of the important runtime flags. None are required, but `--token` is reccomended to avoid sending your access token over TCP, and required for posting since SMTP authentication is not implemented. I reccomend the `--ascii` flag for retro clients, and `--html --inline` for modern clients.

To connect to it, point your client at the server ip/port, with the username of "username@mastoinstance.com" and the password of your account token, no SSL/TLS/SPA. Some clients will not include the domain name in the username by default, so make sure it includes both parts, or use `--user`.
To connect to it, point your client at the server ip/port, set the username to "username@instance.com", the password to your account token, and disable SSL/TLS/SPA/SMTP authentication. If `--token` is used, the password can be anything. Some clients will not include the domain name in the username by default, so make sure it includes both parts, and use `--user` if all else fails.

On the first connection, MOP3 will fetch the last 40 posts on your timeline, and all posts since the last time it connected on every subsequent connection.
It can't differentiate between clients, so the server will need to be restarted to refetch posts on a new client.
I strongly reccomend turning OFF "Include Original Message"/"Inline reply" and similar settings in your client, as it is very difficult to parse when the reply ends and the original message starts, and the parsing code will often post headers in your mastodon message by mistake.

On the first connection, MOP3 will fetch the last 40 posts on your timeline. On every subsequent connection, it will only fetch the posts that have been uploaded since the last connection. This can't differentiate between clients, so the server will need to be restarted to refetch posts on a new client.
<img src="screenshots/mop3-mac.png" alt="Mail.app displaying Mastodon posts" width="800"/>

## Disclaimer
Expand Down
Binary file added screenshots/mop3-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/mop3-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ struct Args {
/// Only send ASCII to clients, gracefully converts unicode
#[arg(long)]
ascii: bool,
/// Enables smtp server for posting/replying to toots
/// Disables SMTP, posts can only be received, not sent
#[arg(long)]
smtp: bool,
nosmtp: bool,
/// Enables adding images as binary attachments, don't use with --inline
#[arg(long)]
attachment: bool,
Expand All @@ -99,7 +99,7 @@ struct Args {

fn main() {
let args = Args::parse();
if args.smtp{
if !args.nosmtp{
if args.token.as_deref().is_none(){
println!("Error: Must provide token to use SMTP server,");
println!("since I was too lazy to implement SMTP auth.");
Expand Down

0 comments on commit 9a75204

Please sign in to comment.