-   Linux - Server (
-   -   Need help! I am moving from MDaemon to Postfix (

@ngkor 08-07-2008 05:16 AM

Need help! I am moving from MDaemon to Postfix
Hi everyone,

I'm new to Postfix, I plan to run Postfix on Ubuntu Server 8.04 for my branch office. Below are what we have, what we need and problem we face.

Here what we currently have:
My Head Office running Exim 4 as MTA, so all users have to connect to head office to receive their email.

At my branch office we use MDaemon to handle local email and download email from Head Office mail server for our local users. Every user at my branch office has their email account on both MDaemon and Exim (the same email account), I config MDaemon to download email every 15mn from Exim for each user account by using MultiPOP. So our local users send and receive their email via MDaemon.

And here what we need:
I would like to replace MDaemon with Postfix for my branch office, and now I am facing a problem when my local user in branch office try to send email to head office user. Postfix will reject the email with "Unknown Virtual User". I use virtual mailbox domain because my user don't need any linux account.

This problem can be handle by MDaemon with the "Unknown Mail" option, mean MDaemon will forward unknown email address to any other SMTP server (yes, I set it to my head office mail server).

Anyone please advice me how can I configure Postfix to forward Unknown email address to another SMTP server?


Mr. C. 08-08-2008 12:31 AM

I don't think you want a virtual user or virtual mailbox setup. Instead, you want to configure Postfix to relay mail for your domain to your head office. Configure Postfix with the list of valid recipients to avoid spam sent to invalid recipients (which is the most common spam attack).

@ngkor 08-08-2008 03:27 AM

Thanks Mr. C,
Is it possible to use virtual mailbox domain to do this?
Which parameter could be use to relay unknown virtual email to another SMTP?


Mr. C. 08-08-2008 11:21 AM

Review the Postfix addresses classes in general, but here is what a virtual mailbox is:

Users in the virtual mailbox class will have their mail delivered directly to your server.

You said the problem you were facing was "local user in branch office try[ing] to send email to head office user.". Do all your corporate users have the same domain name in their email address? (ex. Where is the primary mailbox for either head or branch office. It sounds like in your description mailboxes lived at the head office, and you just retrieved mail from there. And you sent outbound mail *through* the head office. If this is correct, you have no direct delivery mailboxes, but instead only have mailboxes which are populated by POP.

Is this a private network, or is your head office mail server an MX for all mail delivery for your domain?

@ngkor 08-08-2008 10:38 PM

Hi Mr. C,

Thanks again for your help!

>>>Do all your corporate users have the same domain name in their email
>>>address? (ex.

Yes all our users (head office and branch office) have the same domain name in their email address.

>>>Where is the primary mailbox for either head or branch office.
>>>It sounds like in your description mailboxes lived at the head office,
>>>and you just retrieved mail from there.

Yes you are right. mail server in my branch office is not a real internet hostname, so we can not receive email directly. MX point to my head office mail server that receive all email for my domain.

>>>And you sent outbound mail *through* the head office.

Not exactly yes, Because I have about 70 users at my branch office and over 150 users at Head Office and mostly my users at branch office send email within the office and to customers. So internal email server at my branch office save us a lot of bandwidth.

I set Postfix relayhost = my ISP's SMTP server, so all outbound email send out via my ISP's SMTP server.

>>>If this is correct, you have no direct delivery mailboxes,
>>>but instead only have mailboxes which are populated by POP.

Suppose a customer send me an email (I am at branch office), that email will go to my email box at head office mail server. Then my branch office mail server will download (POP every 15mn) all emails in my mailbox at head office server, and store that email in my mailbox in my mail server at branch office. Finally I use email client to read and reply that email.

Note: Every users at branch office has two email accounts, one on branch office server and another on head office server (both account are the same), and we use the same method to get/send email.

The only problem is that, when I send email to my head office user (the same domain name) Postfix check the recipient email address and reject my email with "Unknown Virtual User".

Is there any parameter in Postfix that can relay/forward those unknown recipient mail to another SMTP server?
Or I am appreciated if you can suggest any better solution for my branch office.

Thanks and Regards,

Mr. C. 08-08-2008 11:54 PM

You really don't want to forward mail for unknown users - this will be an endless source of spam and eventually backscatter.

The typical solution to your problem is to use branch-specific subdomains, such as: # head office, company MX # branch office

and allow your head office to be the MX for the company. This would allow the head office MX to relay any branch office mail directly to your Postfix server. This would allow you to get rid of the 15-minute POP server downloads, as mail is relayed to the branch office immediately.

Your branch office server would accept mail for the domain.

Obviously, this requires coordination with the head office, as they a) need a list of valid recipients in, and b) need to know to relay to the branch office server. This could be done either by internal MX RR or by something like a transport map.

Setup your postfix server with virtual mailboxes for the domain, and populate a virtual mailbox map for all your branch office employees. For inter-office mail, create a transport map which sends mail destined for the head office to send directly to the head office MX, avoiding your ISP. And of course intra-branch mail will go directly to the virtual mailboxes that your server manages.

@ngkor 08-09-2008 02:53 AM

Hi Mr. C,

Actually we have many branch offices and our management preferred the same domain name for all office since the beginning, because it would not confuse our customers and we are only one group.

We are using MDaemon at each branch office, it work fine. It relay unknown recipient email to our Head Office SMTP server.

The reason I want to change to Postfix because I want to use Squid as Proxy Server and I love the stability and security of Linux Operating System.

Is there any trick to make Postfix relay email for unknown recipient to other SMTP server? Same as what MDaemon did.

I read about Exim 4, it is very flexible and come with full features. Did Exim 4 could solve my problem?


Mr. C. 08-09-2008 05:42 PM

Here is a thread where the same topic is discussed.

@ngkor 08-10-2008 08:27 PM

Thanks you so much Mr. C for the link.


All times are GMT -5. The time now is 05:13 AM.