Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-08-2006, 03:56 AM   #1
LQ Newbie
Registered: Jan 2005
Posts: 12

Rep: Reputation: 0
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.

Old 03-09-2006, 02:41 PM   #2
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
The easy way to do this is to add the following to /etc/postfix/

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]
Old 03-27-2006, 11:48 PM   #3
LQ Newbie
Registered: Jan 2005
Posts: 12

Original Poster
Rep: Reputation: 0
OK, i have added the line in the and have created transport with the following lines

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

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

Old 03-28-2006, 04:42 AM   #4
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
put this in your
mydestination = localhost, $myhostname
relay_domains = $mydomain
relay_transport = smtp:[]
Or even better, use postconf to alter the settings for you (-e for edit) - like this:
postconf -e "mydestination = localhost, $myhostname"
postconf -e "relay_domains = $mydomain"
postconf -e "relay_transport = smtp:[]"
Then, to make them take effect do:
*If postfix is running:
postfix reload
*If postfix isn't running:
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'.

Last edited by WindowBreaker; 03-28-2006 at 04:44 AM.
Old 04-06-2006, 03:01 AM   #5
LQ Newbie
Registered: Jan 2005
Posts: 12

Original Poster
Rep: Reputation: 0
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
please help with Postfix+courier+forward+bcc? shadowsa SUSE / openSUSE 2 08-15-2005 10:20 PM
postfix: forward messages to root mozilla Linux - Networking 3 06-23-2005 08:11 AM
Postfix forward to another server BorgKiller *BSD 1 05-27-2005 11:07 AM
Forward All Postfix messages and deliver them dlublink Linux - Networking 1 12-27-2004 10:34 PM
Postfix Forward problem paulten Linux - Networking 1 12-14-2003 08:08 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration