Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenMailBridge

Version française

A generic Simple MAPI bridge between 32-bit and 64-bit Windows.

Many 32-bit applications — legacy ERPs, invoicing/quoting tools, CAD software, anything built years ago and never ported — still send email through the old Simple MAPI API (MAPILogon / MAPISendMail / MAPILogoff). That API resolves a mail provider from the 32-bit registry view, which is exactly where modern 64-bit-only mail clients (Thunderbird, and increasingly others) simply aren't registered anymore. The result: the 32-bit application's "Send email" button fails, with no 32-bit build of the mail client available to fix it.

OpenMailBridge relays that call across the bitness boundary instead of reimplementing any mail client's logic: your 32-bit software makes a normal Simple MAPI call, a small shim DLL forwards it over a local named pipe to a 64-bit relay, and that relay replays a real Simple MAPI call — natively, in the 64-bit registry view where your real mail client is properly registered. The mail client's own compose window opens, pre-filled, exactly as if the 32-bit software had called it directly. No SMTP credentials are ever handled or stored; the actual mail client does the actual sending, as it always did.

How it works

32-bit software  --(Simple MAPI)-->  MailShim32.dll  --(named pipe, JSON)-->  OpenMailBridge.Relay (64-bit)  --(Simple MAPI)-->  your real mail client
  • MailShim32.dll (C++, x86) — registers itself as the system's Simple MAPI provider for 32-bit callers. Contains no business logic: it captures the MapiMessage the caller passed in, serializes it, sends it over a named pipe, and returns whatever code the relay sends back.
  • OpenMailBridge.Relay (.NET, x64) — receives the request and replays a genuine Simple MAPI call against the real, natively-registered 64-bit mail provider (MAPILogon → MAPISendMail with MAPI_DIALOG → MAPILogoff).
  • OpenMailBridge.Tray (.NET, WinForms) — a notification-area icon that hosts the relay and exposes a one-click Activate/Deactivate toggle. Runs in the interactive user session (not a Windows service — the compose window has to be visible on screen), and deliberately does not run elevated: see Why the Tray doesn't run as administrator below.

The bridge never hardcodes a mail client's name anywhere. It's a generic Simple MAPI client, standing on the correct side of the 32/64-bit boundary — nothing more.

Requirements

  • Windows 10/11, 64-bit
  • .NET 8 Desktop Runtime (installer is framework-dependent, not self-contained)
  • A Simple MAPI–compliant 64-bit mail client already installed and set as the default mail app (Thunderbird is the one this has been built and tested against)

Installation

Download the latest OpenMailBridge-Setup-<version>.exe from Releases and run it. It will:

  1. Install the 64-bit Relay/Tray under Program Files\OpenMailBridge and the 32-bit shim under Program Files (x86)\OpenMailBridge.
  2. Register a scheduled task that starts the Tray at logon.
  3. Optionally (checked by default) activate the bridge immediately — i.e. register it as your system's default Simple MAPI provider.

You can toggle activation at any time from the Tray icon's context menu (Activate/Deactivate) — no reinstall needed either way.

Building from source

git clone <this repo>
cd OpenMailBridge
.\scripts\build-installer.ps1

Requires Visual Studio with the "Desktop development with C++" workload, the .NET 8 SDK, and Inno Setup (winget install JRSoftware.InnoSetup). Produces dist\OpenMailBridge-Setup-<version>.exe.

To install straight from a source checkout without building the packaged installer, scripts\install.ps1 (run from an elevated PowerShell) does the same file layout + scheduled task setup directly.

Uninstalling

Uninstall via Settings > Apps (or Control Panel > Programs and Features) like any other Windows application. This does a full reset: restores whichever mail provider was configured before OpenMailBridge was first activated, removes the scheduled task, deletes all installed files, and clears its logs and backup data — nothing is left behind.

Troubleshooting

See docs/runbook.md for log file locations, common errors, and manual rollback steps.

Why the Tray doesn't run as administrator

The Tray hosts the pipe server that drives the real mail client's compose window. Windows' UIPI (User Interface Privilege Isolation) prevents an elevated process from reliably controlling a non-elevated one's UI — which is exactly what happens if the Tray runs elevated: MAPISendMail hangs against a normal-privilege mail client. So the Tray always runs at normal integrity level; only the one-time registry write (the Activate/Deactivate toggle) elevates on its own, via its own UAC prompt, each time it's used.

Project status

All planned milestones (native shim, pipe relay, MAPI registry redirection, tray UI, log rotation, packaged installer) are implemented and tested end-to-end against Thunderbird. See plan-mapi-bridge.md for the full implementation history and architecture notes, including a couple of undocumented Windows MAPI registry quirks discovered along the way.

License

MIT

About

A generic Simple MAPI bridge letting 32-bit software send email through your installed 64-bit mail client

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages