Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am setting up a postfix email gateway. It will not hold any mail but will accept email for my domain and forward it to another internal mailserver and relay mail out from the internal server.

One of the main problems is that I am working on a live running system and this will be an upgrade so I am using a test domain which I will change at some point to the real domain.

I tried various methods but found the simplest way (that worked) was to use a script to create an aliases file (from ldap entries). There are various problems with this method. The main one being that the entries can't be of the simple form user@example.com because the gateway doesn't know where to send them. They have to be of the form: user@realmailserver.example.com.

What I would like doesn't seem hard but I can't get my head around the postfix documentation. There seem to be various ways but none of them seem to work. Most of the examples I have found on the web assume the mail is going to end up on the server. I want a list of users somewhere, preferably of the form: user1, user2, etc rather than user@example.com (I can easily generate this list) and I would like postfix to forward all email to example.com to a particular server: ie realmailserver.example.com.

Can anyone suggest clues as to how I might do this?

share|improve this question

2 Answers 2

You should setup postfix as a backup MX:

http://www.howtoforge.com/postfix_backup_mx

Postfix can also use LDAP queries for recipient verification but a script to create aliases file should do the job very well too.

share|improve this answer

The main one being that the entries can't be of the simple form user@example.com because the gateway doesn't know where to send them.

Then you have to tell it where to send them.

Relevant documentation: http://www.postfix.org/transport.5.html

This accepts entries of the form:

example.com smtp:[nexthop-destination]

Where nexthop-destination can be your internal mailstore IP.

share|improve this answer

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.