LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix forward (https://www.linuxquestions.org/questions/linux-software-2/postfix-forward-422755/)

arjanhs 03-08-2006 03:56 AM

Postfix forward
 
I'm using postfix as a receiving mail server, i wanted to forward all incoming mail to an other host, what do i need to change for this.

Arjan

Wells 03-09-2006 02:41 PM

The easy way to do this is to add the following to /etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport

And then create the /etc/postfix/transport file with the following type of information:

server1.whatever local:
server2.whatever smtp:[111.222.333.444]
server3.whatever smtp:[server3.whatever]

arjanhs 03-27-2006 11:48 PM

OK, i have added the line in the main.cf and have created transport with the following lines

<localhost name> local:
<domain name> smtp:[192.168.0.80]

I wanted all mail received on the local host be forwarded to 192.168.0.80, will it work this way ?

Arjan

WindowBreaker 03-28-2006 04:42 AM

put this in your main.cf:
Quote:

mydestination = localhost, $myhostname
relay_domains = $mydomain
relay_transport = smtp:[192.168.0.80]
Or even better, use postconf to alter the settings for you (-e for edit) - like this:
Code:

postconf -e "mydestination = localhost, $myhostname"
postconf -e "relay_domains = $mydomain"
postconf -e "relay_transport = smtp:[192.168.0.80]"

Then, to make them take effect do:
*If postfix is running:
Code:

postfix reload
or
*If postfix isn't running:
Code:

postfix start
*Note: The reason I put in the 'mydestination' parameter is to show you that it shouldn't have $mydomain listed, since that's listed as 'relay_domains'.

arjanhs 04-06-2006 03:01 AM

With this script the messages are forwarded, but when someone outside tries to connect to send a message a relaying is denied message is served.

So only local generated messages are forwarded, when come from the internet they are denied.

Arjan


All times are GMT -5. The time now is 11:35 PM.