MacOS – OSX Mail Server Forward to External Address

emailmacososx-serverserver.app

I have an OSX mail server set up on Mavericks (10.9.2 I believe). I'm trying to set up a few addresses that should do nothing but forward to external gmail addresses. For example, let's say I want user@example.com to forward to myname@gmail.com. If I just try to specify myname@gmail.com as the forwarding address in server.app, it doesn't work.

Oddly, internal forwarding works. For example, say I have example.com and example2.com set up on my mail server. I can successfully forward from example.com to example2.com, but not to any external domain. Any suggestions?

Best Answer

In my experience this applies to Mavericks (10.9) and Yosemite (10.10) the same way that Apple says to do it for Mountain Lion.

https://support.apple.com/en-ca/HT5032

  1. In Server.app, go to Users and select a user.
  2. Click the gear icon (or Control-click the user name) and choose "Edit Mail Options..."
  3. From the "Mail should be:" pop-up menu, select "forwarded".
  4. Enter the forwarding email address in the "to email address:" field.

Additionally or alternatively, there is also a configuration file at /etc/aliases, /etc/postfix/aliases, and/or /Library/Server/Mail/Config/postfix/aliases which can be edited (using sudo) and in the area "# Put your local aliases here." you could put the line:

user: myname@gmail.com

If you want a copy to stay in the local mailbox of user you could use:

user: user,myname@gmail.com

If you want copies to go to additional accounts, they are separated by commas.

some-name: user1,user2,user3

This can be used for email addresses that do not have accounts on the machine such as webmaster or postmaster.

After saving the file, one needs to run the command:

sudo newaliases

I have done this for Mavericks Server for local email addresses, recently tested it for Yosemite Server and found that it works for external address too.

Note that individual aliases can also be added for particular users in Server.app.

Also of possible use are the notes kept by "magnusviri" about managing postfix on OS X Server (3.1.2) on Mavericks 10.9.4 - there is disussion about the different locations of configuration files between /etc, /etc/postfix, and/or /Library/Server/Mail/Config/postfix/ Only one of these three locations will be being used by your setup, so editing the "wrong" files will have no effect on the system's behaviour.

http://www.magnusviri.com/OS_X_Server/os-x-server-postfix.html