CoolFace
Apppublic

ohmyapi/outlook2api

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Outlook2API

Mail.tm-compatible REST API for Outlook/Hotmail/Live accounts with admin panel and batch account registration.

Features

  • —Mail API — Mail.tm-compatible Hydra API endpoints (domains, accounts, token, messages)
  • —Admin Panel — Web UI for account management, bulk import/export, webmail with compose/reply, stats dashboard
  • —Batch Registration — Automated Outlook account creation via GitHub Actions
  • —CI Auto-Import — Registered accounts automatically imported to admin panel
  • —Verification Code Extraction — GET /messages/{id}/code extracts OTP from emails

Quick Start

bash
# Install dependencies
pip install -r requirements-api.txt

# Start the API server
python -m outlook2api.app

# Open http://localhost:8001 for homepage
# Open http://localhost:8001/admin for admin panel (default password: bk@3fd3E)

Docker

bash
cp .env.example .env
docker compose up -d outlook2api

API Endpoints

Mail API (Mail.tm-compatible)

MethodPathAuthDescription
GET/domainsNoList supported email domains
POST/accountsNoRegister account (validates IMAP)
POST/tokenNoGet JWT bearer token
GET/meBearerCurrent user info
GET/messagesBearerList inbox messages
GET/messages/{id}BearerGet single message
GET/messages/{id}/codeBearerExtract verification code
DELETE/accounts/meBearerDelete account

Admin API

MethodPathDescription
POST/admin/api/loginLogin (returns token)
GET/admin/api/statsDashboard statistics
GET/admin/api/accountsList accounts (search, filter, paginate)
POST/admin/api/accountsAdd single account
POST/admin/api/accounts/bulkBulk import (["email:pass",...])
POST/admin/api/accounts/uploadFile upload (email:password per line)
PATCH/admin/api/accounts/{id}Toggle active / update notes
DELETE/admin/api/accounts/{id}Delete account
GET/admin/api/accounts/{id}/passwordReveal password
GET/admin/api/accounts/{id}/messagesFetch messages via IMAP
POST/admin/api/accounts/{id}/sendSend email via SMTP
GET/admin/api/exportExport all active accounts

CI Auto-Import

GitHub Actions automatically imports registered accounts to the admin panel.

Required secrets:

  • —CAPTCHA_CLIENT_KEY — YesCaptcha/CapSolver API key
  • —PROXY_URL — HTTP/SOCKS5 proxy
  • —OUTLOOK2API_URL — Admin panel URL (e.g., https://ohmyapi-outlook2api.hf.space)
  • —ADMIN_PASSWORD — Admin panel password
bash
# Trigger registration + auto-import
gh workflow run register-outlook.yml -f count=5 -f threads=1

Environment Variables

NameDefaultDescription
OUTLOOK2API_JWT_SECRETchange-me-in-productionJWT signing secret
ADMIN_PASSWORDbk@3fd3EAdmin panel password
DATABASE_URLsqlite+aiosqlite:///./data/outlook2api.dbDatabase URL
OUTLOOK2API_HOST0.0.0.0API bind host
OUTLOOK2API_PORT8001API bind port
OUTLOOK_SMTP_HOSTsmtp-mail.outlook.comSMTP server host
OUTLOOK_SMTP_PORT587SMTP server port

HuggingFace Deployment

Deployed at: https://ohmyapi-outlook2api.hf.space

Project Structure

outlook2api/
├── outlook2api/               # FastAPI mail API + admin
│   ├── app.py                 # Application entry point
│   ├── routes.py              # Mail.tm-compatible API routes
│   ├── admin_routes.py        # Admin API routes
│   ├── database.py            # SQLAlchemy models (Account)
│   ├── auth.py                # JWT auth helpers
│   ├── config.py              # Environment config
│   ├── outlook_imap.py        # IMAP client
│   ├── outlook_smtp.py        # SMTP client (send email)
│   ├── store.py               # Legacy JSON file store
│   └── static/                # Frontend
│       ├── index.html         # Homepage
│       └── admin.html         # Admin panel
├── register/                  # Batch registration
│   ├── outlook_register.py    # DrissionPage registrar
│   └── captcha.py             # FunCaptcha cloud solver
├── .github/workflows/
│   └── register-outlook.yml   # CI: register + auto-import
├── Dockerfile.api
├── Dockerfile.register
├── docker-compose.yml
├── requirements-api.txt
└── requirements-register.txt