Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to configure an SMTP MTA to accept all mail addressed to any domain and deliver it to my local user account.

It would be very useful for debugging mail sent in some code I'm working on. I'll be running the server locally - no outside world interaction required.

To be clear:

user@gmail.com -> delivered to -> cam8001@localhost

dogs@live.com -> delivered to -> cam8001@localhost

anything@any.domain.co.uk -> delivered to -> cam8001@localhost

share|improve this question
add comment

1 Answer

I found this article explaining how to do it with postfix.

The key is:

luser_relay = cam8001@localhost
local_recipient_maps =

as explained in the article:

luser_relay is the local user on the machine to catch all email that does not belong to an existing local user. luser_relay documentation.

local_recipient_maps is left blank to stop Postfix from checking if the user exists on the local machine. This is very important, without this line, Postfix will still reject the mail and send a bounce message.

After adding the above two lines to the configuration, apply the changes and restart Postfix.

share|improve this answer
    
This is part of the answer, I found the full answer here askubuntu.com/a/206775/111625 –  aland Dec 2 '12 at 23:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.