Search code examples
emailimaplocalcatch-all

Setting up catchall email for testing purposes


Is there a way to set up test email server that would have catchall mail, without actual owned domain (e.g some fake domain)? If so, can someone write it how

I would like to have such server for testing purposes, because I don't want to use real email server with real catch all mail to test some things (real one is used in production).

Is it possible to, for example create such mail locally, so it would behave like a real mail server (even if only locally).

For example define [email protected] email to treat as catch all mail that would take any message which is written in *@mydomain.com (let say there are no other mail boxes)


Solution

  • Easily done: Configure the mail server as though you own the domain, without owning the domain. Add it to your local hosts files and/or nameservers.

    Note, though: Make sure you pick a domain that doesn't exist. If you pick google.com and send lots of mail to "your" [email protected], you're setting yourself up to make a mistake and deliver mail to the real Google.