Mail and Webhooks
The local SMTP inbox, sign-in codes and links, and signed webhook requests with real-webhook capture.
Mail and Webhooks
Two things your app does are hard to test on your own machine: sending mail, and receiving webhooks from a provider such as Stripe or GitHub. Bifurc handles both.
Local mail inbox
The engine runs an SMTP server on 127.0.0.1:1025, with no login and no TLS. Point the mail settings of the app you are building at it, and what it sends lands in Bifurc instead of a real mailbox.
- Set your app's SMTP host to
127.0.0.1and port to1025 - Trigger a mail: a sign-up, a password reset, an order confirmation
- Open Mail in the sidebar, under Routing
Each mail shows its sender, recipient, date, the text and HTML bodies, and the first sign-in code and link it contains, with buttons to copy the code and to copy or open the link. Filter the list by recipient, sender or subject, and Clear inbox to start over.
A mail goes to the workspace that is active when it arrives. Each workspace keeps its last 200 mails on this machine, never in its repository. The port can be changed in Settings, under Servers.
From a terminal:
bifurc mail list --to maya@acme.dev
bifurc mail last --otp --wait 30s
bifurc mail last --link --link-match reset
bifurc mail clear
mail last --otp prints only the code, so a script can type it into the form it is testing. In a flow, a Mail node waits for the matching mail of the run and hands on its code and link.
Webhook requests
A Webhook request sends an event to your endpoint the way the provider would, signed with a secret from one of your vaults, so your handler's signature check runs for real.
- Open Requests and create a Webhook request
- Pick a sample event (Stripe, GitHub and others), or paste your own payload
- Set the URL of your local endpoint, and the vault and secret to sign with
- Send
Capture a real webhook
Press Capture on a webhook request. Bifurc opens a temporary Cloudflare tunnel and shows a public address: paste it into the provider's webhook settings and trigger an event. The first webhook that arrives fills the request with its payload, headers and signature header, ready to send again as often as you need.
Capture needs cloudflared, which Bifurc installs from its official release, during the first-run setup or later in Settings, under Requests. Only the webhooks you capture pass through the tunnel, and the tunnel closes when the capture ends.
From a terminal:
bifurc webhooks listen --name "Stripe checkout" --url http://api.localhost/webhooks/stripe
bifurc webhooks trigger stripe.checkout.session.completed --to http://api.localhost/webhooks/stripe --vault payments
Good use cases
- testing sign-up, password-reset and invoice mails without a real mailbox
- copying the one-time code your app just sent
- running your Stripe or GitHub webhook handler without a real payment or push