r/coolgithubprojects • u/Just--Really---Tired • 1h ago
I built a Windows tray app in Rust + Tauri that copies email verification codes to the clipboard
otp-tray watches your inbox over IMAP (async-imap), detects the verification code in a new email, and puts it on the clipboard. Ctrl+V and you're in.
Rust bits people here might like:
The detector is a separate pure crate (otp-detector): email in, Option<Detection> out. It's tested against 146 synthetic .eml files, and a CI test fails the build if any negative fixture would be auto-copied.
catch_unwind around detection, so one weird email can't take the watcher down. There's also a mutation robustness test that feeds it truncated and mangled mail.
Clipboard writes go through the Win32 API directly so they can set ExcludeClipboardContentFromMonitorProcessing and CanUploadToCloudClipboard = 0, which keeps codes out of Win+V history and cloud sync.
Gmail's IDLE was 10-56 s late in my testing vs 3-7 s for a plain FETCH, so Gmail gets 2 s polling.
4.3 MB installer, MIT. Feedback on the code very welcome.