• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Relay mail for specific domain

rgruyters

Basic Pleskian
I want to set a relay host for a specific domain. As far as I can find this is not possible within the Plesk Panel.

I have edit the main.cf file and updated the transport_maps setting from:

Code:
transport_maps = , hash:/var/spool/postfix/plesk/transport

to:

Code:
transport_maps = hash:/etc/postfix/custom_transport, hash:/var/spool/postfix/plesk/transport

This is whats in the custom_transport.db:

Code:
# postmap -s /etc/postfix/custom_transport
abc.nl	relay:relay.host:587
#

When I try to sent email from (e.g.) [email protected] to any remote address it still sends it directly, not via relay host.

If I change this to:

Code:
*  relay:relay.host:587

It works fine! Same goes when I set the relayhost setting in the main.cf file.

What goes wrong?!

I'm running Plesk version 12.5.30 on a CentOS server.
 
Looks like I have solved it.

For those who are interesting how I done this, I have added the following variable to the main.cf:

Code:
sender_dependent_relayhost_maps = hash:/etc/postfix/sdr_custom_transport

In the sdr_custom_transport i have added:

Code:
@abc.nl  relay.host:587

That is it!
 
Looks like I have solved it.

For those who are interesting how I done this, I have added the following variable to the main.cf:

Code:
sender_dependent_relayhost_maps = hash:/etc/postfix/sdr_custom_transport

In the sdr_custom_transport i have added:

Code:
@abc.nl  relay.host:587

That is it!

Hi, i only did these steps with
Plesk Onyx 17.5 and Debian 8.8
I made this Changes within Postfix but nothing happens.
Still can't send Emails.

What am I missing.

Maybe @UFHH01 has an Idea? :-X

More over i had a message from Monitoring which said Mailserver down.
So service and Status of Postfix was fine, but i couldn't send any Emails more.
Whole Server couldn't send.
 
Last edited:
Hi daanse,

depending to your postfix version, you are as well able to use the setting "DUNNO":

Example:
Code:
[email protected]   DUNNO
@YOUR-DOMAIN.COM           relay.host
... which is documented as well here:


... while you might consider to use the example configuration for postfix 2.7 ( or newer ):
Code:
[email protected]           smtp
@YOUR-DOMAIN.COM           smtp:[relay.host]

( where "relay.host" should equal the MX - entry from your host! ;) )
 
@UFHH01,

i have mail_version = 2.11.3 :)

I just undo everything (from here) because Mailserver didn't worked anymore.
Could you kindly show up some steps, i.e. where i have to change Values in order to get this running correctly?
:-X
 
Hi daanse,

thank you, so at the moment its not possible?
I am actually not sure and have to study for myself how this can be resolved with the old postfix versions and due to the fact that Plesk Team Member are already working on the Debian stretch support for Plesk, I don't really see the need to provide different solutions for outdated postfix versions, sorry. :(
 
For years I'm relaying specific domains to other servers by using transport. Used the same method in sendmail.
I even add entries to that file using a 20-minute cronjob.


grep gmail /etc/postfix/transport
Code:
gmail.com              smtp:mail.relay.com:25
.gmail.com             smtp:mail.relay.com:25

This works for the destination address. Never needed it for the sender address.
By using the other directive in main.cf that was proposed, but the same syntax in the transport file it should work.

Code:
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_transport
 
Last edited:
Back
Top