nkizz / mop3 Goto Github PK
View Code? Open in Web Editor NEWA Mastodon to POP3 Gateway
License: MIT License
A Mastodon to POP3 Gateway
License: MIT License
A boost shows up as a message from the person doing the boost with no indication of who the original author is.
mop3 seems to panick:
RUST_BACKTRACE=full mop3-macos-arm64 --account "[email protected]" \
--token "..." \
--pop3port 10110 \
--ascii --nosmtp
result in the following when pop3 client tries to connect:
Listening on ("127.0.0.1", 10110)
thread 'main' panicked at 'Server sent malformed JSON: Error("expected `,` or `}`", line: 1, column: 9869)', src/main.rs:231:45
stack backtrace:
0: 0x103017794 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb33e6e8152f78c95
1: 0x10302ffec - core::fmt::write::hd33da007f7a27e39
2: 0x103012b94 - std::io::Write::write_fmt::h7edc10723862001e
3: 0x1030175a8 - std::sys_common::backtrace::print::h895ee35b3f17b334
4: 0x103018d1c - std::panicking::default_hook::{{closure}}::h3b7ee083edc2ea3e
5: 0x103018a74 - std::panicking::default_hook::h4e7c2c28eba716f5
6: 0x103019340 - std::panicking::rust_panic_with_hook::h1672176227032c45
7: 0x103019160 - std::panicking::begin_panic_handler::{{closure}}::h0b2d072f9624d32e
8: 0x103017bfc - std::sys_common::backtrace::__rust_end_short_backtrace::he9abda779115b93c
9: 0x103018ebc - _rust_begin_unwind
10: 0x103044654 - core::panicking::panic_fmt::h23ae44661fec0889
11: 0x103044974 - core::result::unwrap_failed::h414a6cbb12b1e143
12: 0x102d5c6e8 - mop3::handle_pop_connection::h1edde0d9242564ed
13: 0x102d5892c - mop3::main::h3c3a97baba12433a
14: 0x102d32678 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0d27018abf24d9ca
15: 0x102d32834 - std::rt::lang_start::{{closure}}::h966e38f1108142fc
16: 0x10300ea00 - std::rt::lang_start_internal::h00a235e820a7f01c
17: 0x102d63e1c - _main
I just gave mop3 a try and it is certainly cool. I am however wondering if there is a sane way to generate more informative subject lines. When looking at the mailbox, it is hard to gauge whether a thread is interesting enough to read without opening it.
Restarting mop3 results in the pop3 client (e.g., thunderbird) seeing & downloading the "last n timeline messages" again. Ideally, mop3 would remember which messages were already fetched (& deleted) to avoid the re-downloads and subsequent duplicates.
The Rust toolchain comes with rustfmt
to format code to a standard format, run via cargo fmt
. Would you be interested in running it on this code or a contribution that did it. I think it would tidy it up and make it look more familiar/idiomatic.
Some clients doesn't support unicode well, or at least only partly.
Initially I tought that conversion to ISO-8859-1 (Latin 1) or ISO-8859-15 etc. might work, but then I noticed that a lot of post now contains โ
(for things like Iโm
) instead of '
. And then there are emojis.
So maybe --ascii
should use something like https://github.com/anyascii/anyascii#rust (and have the option --unicode
keeping the original unicode)?
Add avatars as X-Face.
I don't think there are any compface(1)
implementation in Rust (yet). Traditionally made by piping trough netpbm etc. and compface as shown in this online X-Face converter https://www.dairiki.org/xface/ i.e. somthing like:
echo "X-Face:$( curl -s $( curl -s https://mastodon.social/api/v1/accounts/1 | jq -r .avatar ) | \
djpeg -grayscale | \
pnmscale -width 48 -height 48 | \
pnmpad --width 48 --height 48 | \
pnmhisteq | \
pgmtopbm -fs | \
pbmtoxbm | compface )"
results in:
X-Face: :Iq]CkX#J|O5E1ZdT>HTzV2'xpv#w:gh$UMHa_5AS<Lc`=qX~4m?^xTtZIv5m?@@r3vR$70
hR/1]kI$+w@xoXm$u"kz1YyLDMz:`F{{$&.]3zXEEUge%VH$pQc87i7NS:A3QhE_c&qO=Nj`QhEo(K
{ds:/"(ZU\Arw^P}jFea5BGY,;G?9WPZ|%b*L"<4brSH}ruF&[*X6y=tZPP=}&Cn/6;[oK;Ynl#kxk
*SZa58&y3UDEf'%%N.r''u.R9:aDs1*5I("j2Wp?}$~K(<y:EexbX?0h%uDg3E{zmSmdmAcZ#^pqxN
KKdAK{%vRcFow6co2d2^
Maybe have an avatar directory of pre-generated files with filenames from hashes of account or avatar-urls?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.