← All articles

How to automate lead parsing from email: newsletter → AI → Telegram

How to automate lead parsing from email: newsletter → AI → Telegram

If you're a freelancer, agency, or expert who receives leads by email, you probably know this pain: dozens of emails a day, each one needs to be read, evaluated, and assessed to decide whether it's worth replying to. Hours go into routine work, and some leads get lost in the flow.

The problem: email is a bottleneck

Newsletters from freelance marketplaces, job openings, tenders, and listings all pour into a single inbox. Manually, it looks like this: open the email → read the brief → estimate the budget and complexity → decide whether to reply → write a personalized response. That's 15–30 minutes per lead. For 20 emails — an entire workday.

The solution: the "Email → AI → Telegram" pipeline

The ready-made MailLeads AI engine does this automatically:

  • Email Collector — reads email via IMAP in read-only mode, processes only new emails (by UID), and doesn't re-read old ones.
  • Parser — understands the email structure on its own: subject, description, budget/amount, link, category, identifier.
  • Deduplication — priority id → url → content hash: a lead won't appear twice.
  • AI Analyzer — evaluates the lead across 5 metrics (match, budget, complexity, risks, clarity) and gives a score of 0–100.
  • AI Response Generator — writes a personalized draft reply for each lead.
  • AI Reviewer — checks the draft with a second AI ({approved, score, problems, suggestions}), with up to 2 regenerations if needed.
  • Telegram — sends a ready-made card with buttons: [🔗 Open] [📋 Copy] [✅ Take] [❌ Skip].

Why this is safe

The engine never sends anything on your behalf. It only prepares a draft and reminds you — you perform the final action manually (the "✅ SENT" button moves the lead to "sent" status). The email password is stored only in .env and never appears in logs. No browser automation, hidden APIs, or captcha bypassing.

Resilience to failures

Everything runs autonomously as a systemd service with auto-restart. If email is unavailable, the engine waits and tries again. If the AI goes down, the task goes into a queue. If Telegram is unavailable, the notification will be sent later. Nothing gets lost.

Who it's for

  • Freelancers and agencies who receive inquiries by email.
  • Experts and service sellers who want to respond faster than competitors.
  • Developers who need a ready-made AI pipeline for their own source.

What's included

Full source code (Python), a ready-made Telegram card, a management bot with statistics, email diagnostics (read-only), a healthcheck, tests (unit + E2E), and documentation. It deploys in 5 steps: fill in .env → check python3 -m diag_test_imap → run python3 main.py email.

You can download the ready-made engine and view all tiers (source / source + guide / turnkey setup) on the product page.

→ Open MailLeads AI

💼 Useful for business and sales?

Practical prompts for business, sales, and marketing — on topic:

🔗 The entire prompt library · "Business" category

Ready-made product on the topic: Prompts for Programmers — grab it and apply it right away.

AIAutomationEmailTelegram

🎁 Забери бесплатный набор AI-промптов

6 отобранных промптов для бизнеса, кода и контента + доступ к библиотеке 2000+. Без оплаты.

✈️ Get the kit on Telegram

Need ready-made automations for your business?

Browse products