0

Preferably this could be done with a virtual instance of a mail server on an existing Linux machine but I'm willing to run a whole other install (Linux or Windows) to get this to work.

Basically a system we use generates emails to customers when we do certain things. On the testing setup, we regularly import a full live snapshot to test reports etc. The problem is that this can end up with us sending incorrect emails to our customers.

My goal is the specific a different mail server on the server which would accept all mail, then redirect it back to the dev team. Best I can come up with is creating catchall address forwards for every domain of every customers. There must be a better option though?

Machine will not be internet facing so spam is not a risk on this.

Edit: There a multiple customer address domains. Any catchall solution would need to not be domain specific. The from field also varies depending on the user logged in or section of the system. We also need to see the emails which is why they are being redirected.

Ryaner
  • 3,097
  • 5
  • 25
  • 33

6 Answers6

1

As towo pointed out, address rewriting is one way. Exim also has a nice framework for this:

http://www.exim.org/exim-html-3.30/doc/html/spec_34.html

BTW, what you want is often referred to as a "catchall" address. That might help in googling a config for your chosen mailserver.

You might also consider modifying your test system to dump mail to a file instead of sending it. That avoids the hassle of having a special "test" mailserver which does the catchall thing; also you could easily parse the file automatically to decide whether the test succeeded. Of course, might not be an option to change the system under test...

sleske
  • 10,009
  • 4
  • 34
  • 44
  • Catchall addresses are a *bad* idea. It won't be long before your domain is flooded with spam messages, since to the spammers every email they try will appear to be valid. – Kamil Kisiel Jul 21 '09 at 06:32
  • @Kamil: In principle you're right. But read the question: "Machine with not be internet facing so spam is not a risk on this.". – sleske Jul 21 '09 at 10:49
0

Most mail servers support rewriting addresses or changing delivery method base on some metric over the input mail. You could either rewrite all outgoing addresses with a local user, or just change the delivery method to dump it unceremoniously into a file.

If you're using postfix, for example, there's a rather thorough documentation available, even though it does not specifically list your case.

towo
  • 1,887
  • 14
  • 12
  • The rewriting all comes in from of from -> to. I've yet to see it handle a * -> to although I don't it can do *@domain -> to. All these addresses a fully valid addresses that I need changed. – Ryaner Jul 08 '09 at 12:00
0

As a thought, your test setup of your app will have a different IP then the production one correct?

Could you setup your existing mail server so that all email from IP xyz get redirected to user abc?

This lets you keep your test app exactly the same with only mail server changes now.

SpaceManSpiff
  • 2,547
  • 18
  • 20
0

I would assume those emails are being sent from the one account. Is it practical to temporarily have your mail server refuse mail from that account for the duration of the tests?

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
0

I'd suggest using sieve for your needs, since it's not tied to a particular MTA. We use it extensively to filter/block for ourselves and our customers.

0

I'm looking for something similar to use as an SMTP server in a test environment. So far I've found subethasmtp, Devnull SMTP server and Dumbster, but I haven't had opportunity to test any of them yet.

Ideally I'd like something with a web interface to review and manage the emails it received.

Evan
  • 349
  • 1
  • 3
  • 6