Routing the world

Routing & IT System Administration

Archive for June 2012

Plesk Postfix Domain Based Smarthost

with 4 comments

In many situations a client needs to redirect all his mail to another SMTP server and you have the need to convert your Plesk Server for this domain to “SMTP Transport Mode“.

This is usefull for example, when a client has a hosting server or is hosted in a multidomain environment and wants to redirect all the mail received to his corporate mail server, like a Microsoft Exchange Server.

There is very few documentation about this in Parallels Forums and I know that can be a little bit scary to modify the Plesk Postfix Configuration Files. Don’t worry, this is what you have to do in five easy steps.

    1. Edit the file /etc/postfix/main.cf and if no set add the next two lines. In the first case, is allways defined, you have to add the last “hash”.
      virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual, hash:/etc/postfix/virtual_mailbox_maps
      transport_maps = hash:/etc/postfix/transport
    2. Create the transport file in /etc/postfix as defined before with this content. NOTE: example.com is the domain you want to transport mail to another SMTP.
      example.org smtp:[IP_or_Hosname]
    3. Create the virtual_mailbox_maps file with this content, this is done to maps all the email addresses to the end server:
      @example.com @example.com
    4. Make a postmap of both files, transport and virtual_mailbox_maps to make it Postfix readable
    5. Restart Postfix daemon “et voilá”

I hope this configuration will be helpfull to you. In this case leave a comment.

Advertisements
%d bloggers like this: