Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Setting up postfix for a split domain

Posted on 2010-01-07
Medium Priority
Last Modified: 2013-11-30
I have a Linux/Postfix mail server currently handling email for many domains. For one of these domains I have 60 or so pop3 accounts most of which are accessed by the SBS POP3 connector for email, but some are accessed directly as the users are not part of the main network (so there are no SBS licences for them - the directors children are some of them)

I want the email for most of the accounts to be forwarded via smtp to the SBS/exchange server without using the pop3 connector but leave a few of the accounts local on the postfix server.

I know how to relay email for an entire domain and how to setup local mailboxes but not how to mix these within a domain. I also need to ensure that email sent from either server can reach recipients on the other server.

I believe this is called a split domain and can setup the exchange end no problem but don't know the postfix config.

Incidentally the server is Slackware 11 with Postfix/Dovecot
Question by:GraemeEvans1
  • 3
  • 3

Expert Comment

ID: 26200384
You need to utilize the Transport Map.

You can specify specific accounts to go to certain ip's(servers) or hostnames.
accounts you want to have delivered locally you need not add to the transport map.


you SBS server ip is ( - replace with your servers real ip.

in the transport file make an entry like the following



Expert Comment

ID: 26200478
Sorry got cut off:

in the transport file make an entry like the following

someuser@somedomain.com     SMTP:[]


someuser@somedomain.com RELAY:[sbsHostname.yourdomain.com]

Repeat for each user you want to forward to the SBS server.

make sure you have:

transport_maps = hash:/etc/postfix/transport

in your config

Either should work to move mail to the sbs server.
A few other notes about your scenario.
You probably want to make the SBS servers' smart host your postfix server. That way all mail in and out is relaying through your postfix box.


Author Comment

ID: 26200530
Transport map? I have a relay_maps and a transport file.

The transport file is formatted as:
somedomain.com relay:[]

the relay_maps:
#catch all relay
@somedomain1.com RELAYALL

#specified relay
someuser@somedomain.com OK

However after configuring this and postmap each file I just get "Recipient address rejected: User unknown in virtual mailbox table" bounced when I try to send email
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.


Author Comment

ID: 26200640
I do have the domain in my vdomains file but I require this for the local accounts that need to remain, I think?

Expert Comment

ID: 26200857
you can Append the transport file:
somedomain.com relay:[] - IF you are NOT forwarding the entire domain remove this line
userToForward@somedomain.com relay:[sbsServerIP]
anotherUserToFor@anotherdomain.com relay:[sbsServerP]
auser@somedomain.com relay:[sbsServerip]
just keep adding per user forwarders

when you try that you are getting the error?

Accepted Solution

GraemeEvans1 earned 0 total points
ID: 26209869
I still get the error

however I have found a solution, I have added virtual aliases for all the accounts I want smtp'd and given them the domain.local address exchange already has for each user.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Suggested Courses
Course of the Month15 days, left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question