Git Product home page Git Product logo

lesst's Introduction

ВАЖНО

29.01.2024 я решил кардинально переосмыслить данный проект и сделать новую версию, исправив недочеты Lesst. Этот репозиторий станет архивом. Если Вас заинтересовал проект, Вам стоит посмотреть новую версию: https://github.com/realkarych/postamt

Lesst — less than Email client

Installation Guide

Описание проекта

Полноценный почтовый клиент в Telegram. На базе Telegram BotAPI и Форумов (реализации "тем" / "тредов" в Telegram).

image

Функциональность | Особенности бота

  • Пользователь может подключить до пяти почтовых ящиков (Yandex, Gmail, MailRu). К каждому ящику создается форум для получения и отправки Email-ов.

    Снимок экрана 2023-07-09 в 03 05 36
  • Все вложения к письмам присылаются в качестве файлов прямо в Telegram.

    image
  • Все входящие письма сортируются по Email-адресам. Таким образом, пользователь получает все письма (включая спам), но может отключать уведомления / блокировать письма от конкретного Email-адреса. Благодаря этому, важное письмо не затеряется в "Спаме" и не будет обработано почтовым автофильтром.

    Снимок экрана 2023-07-09 в 04 11 11
  • Сразу после подключения ящика, бот подгружает последние письма и сортирует их. Таким образом, пользователь может искать контент по последним письмам сразу после начала работы с ботом. Это аналог полноценного импорта в других почтовых клиентах.

    image
  • После настройки и первичного анализа почты, каждый входящий Email будет приходить в чат моментально. Пользователю приходит стандартное уведомление в Telegram.

    Снимок экрана 2023-07-09 в 03 35 14

Технический Стек

  • Python3.11
  • Poetry — менеджер зависимостей.
  • Aiogram — асинхронный фреймворк для работы с Telegram BotAPI.
  • Nats — реализация доставки сообщений.
  • Mozilla ProjectFluent — система локализации. Бот работает на английском и русском языках.
  • PostgreSQL (реляционная бд) + SQLalchemy (ORM) + asyncpg (коннектор) + alembic (миграции)
  • Набор инструментов для асинхронной подгрузки Email-ов по IMAP и отправки по SMTP.
  • Для шифрования при хранении пользовательских данных используются KDF, message digests, symmetric ciphers. Библиотека: https://pypi.org/project/cryptography/.
  • APScheduler — аналог crontab — управление регулярными процессами.
  • Systemd — запуск приложения на сервере. Можно заменить Docker-ом.
  • Полный перечень использованных инструментов можно посмотреть в зависимостях проекта.

lesst's People

Contributors

realkarych avatar

Stargazers

 avatar

Forkers

zoriolan

lesst's Issues

Krakozyabra in Email text

Problem on image (only with Cyrillic symbols):
image

Reason:

  1. bug in parsing of the Email content
  2. bug in IMAP API: wrong response comes

Fix ideas:

  1. Try to use another way of parsing Email content
  2. Replace email html_text with plain text and try to parse it

#smtp Telegraph and Telegram

Realize two methods of sending Emails:

  1. Telegraph. User creates Telegraph note and provides url with destination Email. We should parse it and create Email with full formatting compliance, with photo attachments. Subject equals title, your name equals last part of Email (farewell), your story equals plain text with formatting.
  2. WebApp. Idea is in brainstorming.

DevOps

  1. Add docker-image.
  2. Add restarting nats server.

Menu handlers

Handle menu button clicks (subscription may be realized later, but click should be handled).

Forum events

In cases where User removes Bot from Forum, removes Forum, restrict Bot, we should handle them and remove forum from table emails.
This will allow the user to remove the bot from one forum and add it to another, and also reduce the load on fetching Emails with forums from database.

Initial Email fetching

In-need a beautiful algorithm that, with the help of queues and a stack, will provide the first Email fetching and will create topics based on Emails-address-list and n-count last Emails.
In first increment, I'll try to fetch effectively last 30 Email-adresses.

Last Email bug

The last sent Email does not fetch in the mailbox. After new (income) Email, penultimate drops.

Email duplicates: race condition

Some Emails, because of race condition between initial fetching and interval fetching, sends more than 1 times.
How to fix: refuse from initial fetcher to checking if the last sent email is None (0). Remove initial fetcher like a concept. This will solve problem with concurrency.

Emails count Limitation

In-need to limit the ability to connect an infinite number of Emails.
Max Emails count should equals 5.

Cancel button

In all stages of Email-registering pipeline the default menu reply keyboard should be changed to Cancel button and Back button, that cancel process and return to previous stage accordingly.

Email design

Fix Email html styles. Make bold subject, Date

Mailbox service

  1. Build universal Mailbox service built on asynchronously IMAP and SMTP protocols.
  2. Integrate Gmail, Yandex, MailRu mailbox services with connection guidelines and unique registering pipelines.

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.