Free/Open Source mail server that supports arbitrary names (same domain)

0

1

I have seen in some websites that lets you send a mail to an arbitraryString@mydomain.com and it still gets delivered. Note: Of course the domain name would be the same. I am sorry I don't know the correct terminology to be used in this question.

I am handling a test automation scenario for a certain website and I need to generate random email addresses for the registration process. Then I want to access that email using POP and see if the registration confirmation email is received.

So the only possibility is to run our own mail server and let all the mails to be directed to that server.

The only issue is the generation of email addresses. As 100's of test cases are run every day, we want the randomly generated email addresses to be valid, working and accessible from code.

What is this functionality called? Virtual addresses ? Aliases? And most importantly, what free/open source mail servers support this functionality?

UPDATE: I just found out about the catch all account. This sure sounds good but the issue is that emails generated from all the test cases will be directed to this email address. It would be better if I can access the received emails per email address basis.

Ranhiru Jude Cooray

Posted 2011-11-22T05:38:02.917

Reputation: 515

Why not use someFixedString+arbitraryString@mydomain.com? – Ignacio Vazquez-Abrams – 2011-11-22T06:00:43.963

That's a good idea, but all the emails will go to the same inbox. I am trying to avoid that. But I will keep this as my last resort. Thanks :) – Ranhiru Jude Cooray – 2011-11-22T06:06:45.260

You mean you want the emails to be delivered to real email address, that you can subsequently access with a real email client? Then you need a real email account, not an alias or virtual account. So the answer is - any open source email server will allow the creation of 100s of email accounts. Exim + dovecot would be a good combination. – Paul – 2011-11-22T06:11:42.300

You can still check the To header and verify the result regardless. – Ignacio Vazquez-Abrams – 2011-11-22T06:18:28.637

@Paul: Yes. But will I be able to create those random email addresses through a programming language at run time? Or will I have to keep the addresses generated before running a test case? – Ranhiru Jude Cooray – 2011-11-22T06:25:59.840

Answers

1

As the requirement is to generate real mailboxes that can be accessed via pop3, a linux server may be the simplest choice.

SMTP server for incoming email: exim POP3 server for collecting emails via pop3: dovecot

Adding users on the fly can be done with

useradd -m -p <password>

Where password is pre-encrypted password, generated by the crypt() function. You could use the perl crypt() function to generate the passwords. Once the account exists on the linux box, thats all that is needed to accept emails. Tell exim you are using the Maildir format ideally, so you can monitor individual emails from the comment line in the /home/user/Maildir/ folders.

Paul

Posted 2011-11-22T05:38:02.917

Reputation: 52 173