Skip to content

A utility to fetch email messages from Gmail and send it to Telegram via a bot.

License

Notifications You must be signed in to change notification settings

sturdek/InternetSeparationAdapter

 
 

Repository files navigation

InternetSeparationAdapter Build Status

A utility to fetch email messages from Gmail and send it to Telegram via a bot.

Requirements

Configuration

A configuration file should be in JSON format. The format should adhere to the Config class in the source code.

Example

{
  "TelegramApiToken": "token from @BotFather",
  "TelegramChatGroupIds": [-11111111111111],
  "StoredGoogleCredentialsPath": "./config/somewhere",
  "GoogleCredentials": {}
}

The GoogleCredentials object in the JSON file should be copied from the OAuth credentials provided by Google when you create the credentials to access the Gmail API.

Running it

Build the application using mono:

nuget restore
xbuild /property:Configuration=Release /property:OutDir=build/
build/InternetSeparationAdapter.exe path/to/config.json

There is also a Docker image to run the application, but you need to have gotten the OAuth credentials for the user you are trying to connect to before hand. You can configure StoredGoogleCredentialsPath above to point it to somewhere where you can then dump the credentials. See the issue.

Since the Docker image mounts /usr/src/app/build/config as a volume, you can put it inside your config directory.

An example docker-compose.yml file might look like:

version: "2"
services:
  xxx:
    build: .
    restart: always
    volumes:
      - ./config:
    command: ["config/xxx.json"]

Tests

Tests are missing! We need to write them =X

About

A utility to fetch email messages from Gmail and send it to Telegram via a bot.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%