• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Go
  • License
    BSD 2-Clause "Sim...
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bridge written in Golang to receive and write emails in matrix

Matrix-EmailBridge

A Matrix-bridge to allow you receiving and sending emails in Matrix. You can have multiple email accounts and write emails to one or multiple recipients.

Installation

Compile method

git clone https://github.com/JojiiOfficial/Matrix-EmailBridge
cd Matrix-EmailBridge/main
go get -v -u
go build -o emailbridge
./emailbridge

The last command executes the bridge once to create the probably missing config file.
Continue: --> Configure

Docker method

DockerHub: https://hub.docker.com/r/jojii/matrix_email_bridge

Run

docker pull jojii/matrix_email_bridge

to pull the image. Then create a container by running

docker run -d \
--restart unless-stopped \
-v `pwd`/data:/app/data \
--name email_bridge \
jojii/matrix_email_bridge

This will create and start a new Docker Container and create a new dir called 'data' in the current directory. In this folder data.db, cfg.json and the logs will be stored.

After configuring the bridge you have to run

docker start email_bridge

to start the docker container again.
Note: 'localhost' as 'matrixserver' (in cfg.json) wouldn't work because of dockers own network. You have to specify the internal IP address of the matrix-synapse server!

Get started

  1. Create a bot user.
  2. Get an access token to your Matrix-Server:
curl -XPOST -d '{"type":"m.login.password", "user":"@mailBotUsername:your-domain.com", "password":"mailbotPassword"}' "https://matrix.your-domain.com/_matrix/client/r0/login"
  1. Adjust the config file (cfg.json) to make it work with your matrix server:
{
  "allowed_servers": [
    "your-base-domain.com"
  ],
  "defaultmailcheckinterval": 30,
  "htmldefault": false,
  "markdownenabledbydefault": true,
  "matrixaccesstoken": "access-token-from-step-3",
  "matrixserver": "matrix.full-matrix-server-domain.com",
  "matrixuserid": "@mailBotUsername:your-base-domain.com"
}
  1. Invite your bot into a private room, it will join automatically.

If everything is set up correctly, you can bridge the room by typing !login. Then you just have to follow the instructions. The command !help shows a list with available commands.
Creating new private rooms with the bridge lets you add multiple email accounts.

Note

Note: you should change the permissions of the cfg.json and data.db to 640 or 660 because they contain sensitive data.

Features

  • Receiving Email with IMAPs
  • Use custom IMAPs Server and port
  • Use the bridge with multiple email addresses
  • Use the bridge with multiple user
  • Ignore SSL certs if required
  • Detailed error codes/logging
  • Use custom mailbox instead of INBOX
  • Sending emails (to one or multiple participants)
  • Use markdown (automatically translated to HTML) for writing emails (optional)
  • Viewing HTML messages (as good as your matrix-client supports html)
  • Attaching files sent into the bridged room
  • Emailaddress blocklist (Ignore emails from given emailaddress)

TODO

  • System to send passwords not in plaintext
  • Add more header (CC/Bcc)
  • Update the installerscript

More Repositories

1

LiveBudsCli

A tool to control your Galaxy buds+, live and pro (beta) from linux
Rust
175
star
2

rsv

The runit sv command rewritten in rust with additional features
Rust
69
star
3

Matrix-ClientServer-API-java

A small and simple java API for the Matrix ClientServer Protocol
Java
36
star
4

ZimWiki

A fast and lightweight alternative to kiwix-serve
Go
15
star
5

Matrix-Grep-Bot

A Matrix bot to use grep for searching in large messages
Java
12
star
6

GalaxyBuds-rs

A rust wrapper for the GalaxyBudsLive bt protocol
Rust
11
star
7

jisho-cli

A very simple cli tool to look up Japanese words using jisho.org
Rust
10
star
8

MediaD

A Simple and lightweight daemon to handle keyboard media buttons easily
Rust
5
star
9

Japanese_Inflections

A small rust library to conjugate Japanese words
Rust
5
star
10

ScanBanServer

The server for the triplink-system to collect hackers and webscanner across the internet
Go
4
star
11

Reverseproxy

A high performance reverse proxy written in go
Go
3
star
12

Triplink

Listens for incoming port scans and reports the IPs to the ScanBanServer
Go
3
star
13

Tripwire

Create iptable rules to log connections on a specific port
Go
3
star
14

bluetooth-serial-port-async

Interact with Bluetooth devices via RFCOMM channels asynchronously
Rust
3
star
15

TelegramNewsbot

A bot for telegram which sends news for a given country into a channel
Go
3
star
16

Iptables-log-parser

A parser for logs generated by iptables and Tripwire
Go
3
star
17

SSH-Desktop-remote

A cli tool to control a Linux Desktop environment from a different machine
Go
2
star
18

nanisore

Look up japanese text from a screenshot
2
star
19

WhatsappTimeSaver

A bot to reduce useless SmallTalk by answering useless messages
Go
2
star
20

shred

Shredder some files
Go
2
star
21

yayim

Arch linux yay aur helper with personal improvements
Go
2
star
22

YAKB

Yet another karma bot
Go
1
star
23

gaw

GoAwesomeFunctions - A collection of helpful golang functions
Go
1
star
24

Golang-Templates

A collection of templates for go apps
Go
1
star
25

cargo-linked

Display linked packages for compiled rust binaries
Rust
1
star
26

TripPHP

A PHP client for the triplink system
PHP
1
star
27

CompressedVec

An up to 8x compressed Vec<u32>
Rust
1
star
28

FolderActions

A simple tool for linux which allows to run scripts on fs changes
Go
1
star
29

Anki-Jotoba-addon

Jotoba addon for Anki
Python
1
star
30

EasyService

A cli tool to create an systemd service easily
Go
1
star
31

KanjiSRS

SRS tool to learn kanji
Rust
1
star
32

GoLogServer

A simple but powerful centralized logging solution written in go
Go
1
star
33

SystemdGoService

Create, edit, start, stop, enable and disable systemd services easily with Go
Go
1
star