Giter Site home page Giter Site logo

tginbox's Introduction

tginbox

tginbox is a small Rust-based server that listens for incoming SMTP email messages and forwards them to a Telegram chat.

Building

tginbox can be built using cargo as follows:

$ cargo build --release

This will produce a single executable file in the target/release directory.

Usage

Multiple accounts can be defined in the configuration file, as shown in the example config.json included in this repository. For each account, you can specify the Telegram bot and chat ID to which incoming email messages should be forwarded.

To start tginbox with your configured accounts, run the following command:

$ tginbox /path/to/config.json

To-do

  • better handle encoded mails
  • attachments support

tginbox's People

Contributors

r3vn avatar

Stargazers

 avatar  avatar

Watchers

 avatar

tginbox's Issues

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("expected value", line: 1, column: 2)', src/main.rs:15:60

Hello, I'm having problems running the script.
./target/release/tginbox ./Cargo.toml
thread 'main' panicked at 'called Result::unwrap() on an Err value: Error("expected value", line: 1, column: 2)', src/main.rs:15:60
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

run with backtrace command:
thread 'main' panicked at 'called Result::unwrap() on an Err value: Error("expected value", line: 1, column: 2)', src/main.rs:15:60
stack backtrace:
0: 0x55dc4d3c19a1 - std::backtrace_rs::backtrace::libunwind::trace::h66dc1c6acf794faa
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x55dc4d3c19a1 - std::backtrace_rs::backtrace::trace_unsynchronized::ha80d20099a67f790
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x55dc4d3c19a1 - std::sys_common::backtrace::_print_fmt::h7b959d43f35f16d4
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
3: 0x55dc4d3c19a1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdaa196410d9ee0b9
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:44:22
4: 0x55dc4d3ec8ef - core::fmt::rt::Argument::fmt::h0ddfbbe8be3f80d0
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
5: 0x55dc4d3ec8ef - core::fmt::write::h66b3c629f3d623e4
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
6: 0x55dc4d3bdd17 - std::io::Write::write_fmt::hb6d80fba4115e0c2
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
7: 0x55dc4d3c17b5 - std::sys_common::backtrace::_print::h1a49cfb0cf3cce17
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
8: 0x55dc4d3c17b5 - std::sys_common::backtrace::print::hca95c2d0055e42a2
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
9: 0x55dc4d3c2ce3 - std::panicking::default_hook::{{closure}}::hc03c01c56bca600c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
10: 0x55dc4d3c2a74 - std::panicking::default_hook::hb2cb5315b6634f1c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
11: 0x55dc4d3c3269 - std::panicking::rust_panic_with_hook::h75cd912a39a34e8a
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:705:13
12: 0x55dc4d3c3167 - std::panicking::begin_panic_handler::{{closure}}::h1498b46f7849e167
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:597:13
13: 0x55dc4d3c1e06 - std::sys_common::backtrace::__rust_end_short_backtrace::hd36a39b27b98086b
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:151:18
14: 0x55dc4d3c2eb2 - rust_begin_unwind
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
15: 0x55dc4d0cf853 - core::panicking::panic_fmt::h98ef273141454c23
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
16: 0x55dc4d0cfcf3 - core::result::unwrap_failed::h26e7d1a596cddd61
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1651:5
17: 0x55dc4d0d88a3 - tokio::runtime::park::CachedParkThread::block_on::hdbb3e8ff612d272b
18: 0x55dc4d0f05a7 - tokio::runtime::runtime::Runtime::block_on::h418258dd1f26dc17
19: 0x55dc4d0dc9df - tginbox::main::h17b5bc2e5c617a75
20: 0x55dc4d0fde53 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8c84ced7ddd788b1
21: 0x55dc4d0fc3c9 - std::rt::lang_start::{{closure}}::h2863d92c035b8bba
22: 0x55dc4d3b88fb - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h87e9a912d8a0de33
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:284:13
23: 0x55dc4d3b88fb - std::panicking::try::do_call::ha8d57d42181c12cf
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500:40
24: 0x55dc4d3b88fb - std::panicking::try::h2fdb2d19c253437c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464:19
25: 0x55dc4d3b88fb - std::panic::catch_unwind::h9fe5959d2e133449
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142:14
26: 0x55dc4d3b88fb - std::rt::lang_start_internal::{{closure}}::ha072eb7bbeaa0b6a
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148:48
27: 0x55dc4d3b88fb - std::panicking::try::do_call::h983dae29f79ed5db
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500:40
28: 0x55dc4d3b88fb - std::panicking::try::h15014751f4b412ba
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464:19
29: 0x55dc4d3b88fb - std::panic::catch_unwind::hf837426183b1055f
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142:14
30: 0x55dc4d3b88fb - std::rt::lang_start_internal::h2bbe0b58b2b89a9f
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148:20
31: 0x55dc4d0dcac5 - main
32: 0x7f6378078d0a - __libc_start_main
33: 0x55dc4d0cfffa - _start
34: 0x0 -

I have not dealt with cargo before, please help me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.