Registration Workflows: How Developers Can Test With Temp Mail

Registration Workflows: How Developers Can Test With Temp Mail

Registration Workflows: How Developers Can Test With Temp Mail

Use a temporary inbox by hand for the few registration checks that need real internet mail, and a local mail catcher for everything automated. MTempMail's API is off, so it can't be built into a pipeline today.

This post used to describe an integration with our API. Below is something that stays useful: what to test in a registration flow, and with which inbox.

The email cases worth testing

CaseWhat should happenWhere to test
New addressOne mail, quickly, with the right language and nameTemporary inbox, by hand
Link opened on another deviceWorks, or explains why notTemporary inbox, scan its QR code with a phone
Link opened twiceFriendly message, no error pageMail catcher
Code expiredClear text and a resend buttonMail catcher with a changed clock
Resend pressed five timesLimit, and only the newest code validMail catcher
Address already registeredNo hint to strangers that the account exists; the owner gets a mailMail catcher
Capital letters, plus tag, long domain, spacesAccepted or cleaned correctlyUnit test plus mail catcher
Email changed after sign-upNew address confirms, old one is informedTwo temporary inboxes
Mail server downSign-up isn't lost, mail is queuedMail catcher with errors. Mailpit has a Chaos feature for it
Link scannersA security tool that opens links first must not use up the tokenA button on the landing page instead of a GET that confirms

The last one is easy to miss. Corporate filters fetch links. If a simple GET confirms the account, the filter has confirmed it before the user.

A manual run in ten minutes

  1. Open MTempMail twice: once in a normal window and once in a private one. You now have two addresses.
  2. Register on staging with the first. Note how many seconds the mail takes.
  3. Check sender name, subject, preview line, logo, the link's domain, and the plain-text part.
  4. Follow the link. Then follow it again.
  5. Change the account's email to the second address. Both inboxes should receive something.
  6. Request a password reset, and look whether the old link still works after a new one was sent.
  7. Delete the account. Is there a last mail?

Use invented data. The inbox has no password, so don't send real customer names or production links there. For the mail's technical side, paste the test address from the email spam test into your form once.

Automate the rest

Run a mail catcher next to your app in CI. Our Postman post has the commands and scripts, and Mailpit also has a package for Cypress. For tests against an outside domain, use a service with an API, or a catch-all subdomain of your own: every [email protected] ends in one mailbox that your tests can read with IMAP. That needs no third party and no disposable domain.

Should your form refuse disposable addresses?

Developers ask this from the other side, so here is a view from a service that gets refused.

  • Reasons to refuse: free resources with a cost, votes, reviews, regulated products.
  • Reasons not to: you lose honest people who dislike marketing mail, and lists are never complete. The public disposable-email-domains list is a common source, and like any such list it can contain mistakes.
  • A middle way: accept the address, limit costly features until a payment method or phone is added, and show a line such as "you need this address to recover the account".
  • If you refuse, say so. An error like "please use a permanent email" is kinder than a mail that never comes. How blocking works.

Never treat a verified email as proof of identity. It shows that someone could open an inbox at that minute.

Common questions

Can I use temp mail for load tests?

No. Use a catcher. Thousands of messages to a public service look like abuse and will hurt your sender reputation.

Which status should an unverified account have?

Let it exist with limits and delete it after a set period, so that a mistyped address doesn't block its real owner.

Tags:
#registration workflow testing # test sign-up email # temp mail for developers # email verification testing
Zubair Rahmani
Written by
Zubair Rahmani
Zubair is an app and website developer with 7 years of experience. Zubair built and runs MTempMail, a free temporary email service. Contact
Categories