{"id":49273483,"url":"https://github.com/cmpilato/omgmail","last_synced_at":"2026-05-03T01:03:52.080Z","repository":{"id":350131750,"uuid":"1204387658","full_name":"cmpilato/omgmail","owner":"cmpilato","description":"Gmail IMAP gateway","archived":false,"fork":false,"pushed_at":"2026-04-17T00:49:19.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-17T02:37:38.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmpilato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-08T00:57:18.000Z","updated_at":"2026-04-17T00:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cmpilato/omgmail","commit_stats":null,"previous_names":["cmpilato/omgmail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cmpilato/omgmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpilato%2Fomgmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpilato%2Fomgmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpilato%2Fomgmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpilato%2Fomgmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmpilato","download_url":"https://codeload.github.com/cmpilato/omgmail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpilato%2Fomgmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32265977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-25T15:01:10.085Z","updated_at":"2026-05-03T01:03:52.073Z","avatar_url":"https://github.com/cmpilato.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# omgmail - SQLite mail queue bridge\n\n`omgmail` is a lightweight bridge between an email MTA and a remote IMAP destination,\ncollecting emails injected in real time into it via a typical Unix mail pipe, then\ndepositing those mails into a remote IMAP folder system.\n\nThe current implementation focuses on a robust queue foundation:\n\n- SQLite queue with `WAL` mode and configurable busy timeout.\n- Injection command that reads raw mail from `stdin` and stores it quickly.\n- Emergency flat-file fallback when SQLite is unavailable.\n- Processor command with single-instance locking and atomic fetch-and-clear semantics.\n\n## Package name\n\n- Distribution/package name: `OMGmail`\n- Import/module name: `omgmail`\n\n## Install\n\nFrom the repository root:\n\n```bash\npython -m pip install -e .\n```\n\n## Commands\n\nUse the installed console script:\n\n```bash\nomgmail [global-options] \u003ccommand\u003e\n```\n\nCommands:\n\n- `ingest`: reads one raw message from `stdin` and inserts into the queue.\n- `process`: atomically marks all queued rows for a processing attempt, processes each row, deletes\n    successful rows, and keeps failed rows with a stored processing error.\n- `queue`: prints a queue summary table (ID, sender, sent date, last processing attempt, processing\n    error, and subject) with one message per line.\n- `config`: manage persistent configuration in the database.\n  - `config set \u003ckey\u003e \u003cvalue\u003e`: set a configuration value (e.g., `config set imap.host \"imap.gmail.com\"`).\n  - `config get \u003ckey\u003e`: get a configuration value (e.g., `config get imap.host`).\n  - `config delete \u003ckey\u003e`: delete a configuration value (e.g., `config delete imap.password`).\n  - `config list`: list all stored configuration values.\n\nGlobal options:\n\n- `--db-path`: SQLite DB path (default: `~/.local/state/omgmail/queue.sqlite3`).\n- `--emergency-dump`: fallback file path for DB failures.\n- `--lock-file`: lock file path used to enforce single processor instance.\n- `--busy-timeout-ms`: SQLite busy timeout in milliseconds (default: `30000`).\n\n## Example Integration\n\n### Setup\n\nStore IMAP credentials in the database:\n\n```bash\nomgmail config set imap.host \"imap.gmail.com\"\nomgmail config set imap.port \"993\"\nomgmail config set imap.user \"user@gmail.com\"\nomgmail config set imap.password \"app-password\"\n```\n\nBy default, OMGmail will deposit mails that it processes into the \"INBOX\"\nIMAP folder.  But you can change this with an additional configuration:\n\n```bash\nomgmail config set imap.mailbox \"SomeOtherFolder\"\n```\n\nAnd if you have the ability to pre-process incoming email and inject\nheaders conditionally (using, for example, `procmail` and `formail`),\nyou can configure OMGmail to recognize a custom header whose value\noverrides the default destination IMAP folder _for that specific email_.\n\n```bash\nomgmail config set imap.mailbox-header \"X-OMGmail-IMAP-Folder\"\n```\n\n### Ingestion\n\nWith a simple `.forward` file, you can pipe incoming mail to OMGmail:\n\n```\n|/usr/bin/omgmail ingest --db-path /var/spool/omgmail/queue.sqlite3\n```\n\nFor more complicated setups, you might have your `.forward` send mails\nthrough `procmail`:\n\n```\n|/usr/bin/procmail\n```\n\n...and then have your `.procmailrc` file customize the destination\nheader before passing the email to OMGmail:\n\n```\n[...]\n\n:0fw\n* ^From:.*president@whitehouse.gov\n| formail -I \"X-OMGmail-Folder: Important\"\n\n:0\n| /usr/bin/omgmail ingest --db-path /var/spool/omgmail/queue.sqlite3\n```\n\n### Processing\n\nBecause processing involves authentication with a remote IMAP server,\nit's recommended that that cost _not_ be paid as part of the ingestion\npipeline.  But you can drive processing as a cron job, for example:\n\n```cron\n# Upload emails to the remote IMAP every five minutes.\n*/5 * * * * /usr/bin/omgmail process --db-path /var/spool/omgmail/queue.sqlite3\n```\n\n## Cool, But ... Why?\n\nIn late 2025/early 2026, Google more-or-less-silently \"announced\" their intentions to\n[shut down the \"Check emails from other accounts\" feature](https://support.google.com/mail/answer/16604719?hl=en),\nmuch to the utter shock and horror of countless users who love both Gmail's brilliant\ninterface and spam protection _and_ the vanity email addresses they've been using for\ndecades.  C. Michael Pilato was just such a user, and decided to create OMGmail so\nthat he could keep using his primary self-managed-domain email address while still\nusing the Gmail interface to access it.\n\nNow, many users can get around this situation by simply forwarding emails from their\npersonalized accounts to their Gmail accounts.  But Pilato's email was associated with\na long-running domain that has hosted mailing lists, open source software projects, etc.\nSuch domains are spam targets, and not everybody has Google-sized resources to fight\nthat battle.  To naively forward email from the private server to Google's mail servers\nwould eventually cause the former to be blacklisted as a spam relay.  (This is not mere\nconjecture -- it had already happened in the past.)\n\nOther users in similar situations might simply allow Google to be their domain's\nmail handler outright.  But trying to achieve consensus on such a domain-wide\nchange among a bunch of privacy-minded old-school hackers ... not happening.\n\nSo, since Gmail would eventually no longer \"pull\" email from the private server,\nPilato reasoned that the next best thing would be for the private server to \"push\"\nhis email into Gmail via IMAP.  He loses the spam protection that Google offers\nfor mails it routes outright, but he gets to keep the Gmail interface.  (And his\nmails get delivered according to _his_ schedule rather than the often-long-delayed\nautomagical poll rate that Gmail used when pulling emails via POP.)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpilato%2Fomgmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmpilato%2Fomgmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpilato%2Fomgmail/lists"}