fbpx

List of Useful Postfix Administrative Tasks – Create a local email forwarder (distribution list) + Create a global domain forwarder

Here are two useful Postfix commands that will help in everyday Postfix administration of forwarders.

Create a local forwarder

The point of a local forwarder is to ensure that all emails to a specific email address is delivered to another email address. In this instance, the first email address to which it’s directed does not have to exist. It’s a two step process:

cd /etc/postfix
vim virtual

In the virtual file, the following will be needed to added, namely the TO: address, and the FROM: address. Example:

[email protected]                    [email protected], [email protected]
[email protected]                        [email protected], [email protected]

Once the file has been modified, execute this command:

postmap virtual

You’re set! All email to the first column will now be sent to the comma delimited email address(es) in the second column.

Create a global domain forwarder

A global domain forwarder is useful when your mail server’s IP address is blocked and you want email to specific domains to be routed via another server. So email to a domain, e.g. @example.com, originating from Server A, must be sent via Server B.

The main prerequisite for this is to have a mail server that accepts email from the IP address of Server A. So on Server B, mail relay IP address settings must be added.

Then on Server A create a global domain forwarder:

vim /etc/postfix/transport

Add the following to the top of the file:

live.co.za smtp:[mailrelay.yourserver.com]:587
live.com smtp:[mailrelay.yourserver.com]:587
outlook.com smtp:[mailrelay.yourserver.com]:587
hotmail.com smtp:[mailrelay.yourserver.com]:587
office.com smtp:[mailrelay.yourserver.com]:587

References

Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top