LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2009, 02:43 AM   #1
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Rep: Reputation: 17
Postfix: forward mail


Hi,

I'm new to linux/postfix, and would like some help with relaying/forwarding mail from a linux standalone server to our corporate mail environment (exchange 2003).

I installed vmware server on a standalone linux server (Centos 5.2), and wrote a shell script to make backups of the virtual machines. The script makes a tar file from a virtual machine, which is transfered to our backup server. The script includes a procedure to send a mail about the result of that file transfer to a corporate mailaddress (exchange).

I made the following change on the linux server:
-stop sendmail from starting automatically
-install postfix and configure it to start at level 2,3,4 and 5
-adjust main.cf from postfix:
mydomain = companyname.org
myhostname = myservername
mynetworks = xx.xx.xx.0/24, 127.0.0.0/8
relayhost = [ipadress exchange server]
-adjust transport file:
add the line: * smtp:ipaddress exchange server
-configure exchange to allow relaying from the linux server

I have been reading several pages about this topic on the web, but sofar the mail is not relayed/forwarded to the corporate mailaddress.

Any help will be appreciated.

TIA
 
Old 02-03-2009, 08:58 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
On the other server have you allowed the ip address of that machine to be allowed to forward? normally you have to say I allow machine w.x.y.z to relay email to me.
 
Old 02-04-2009, 01:01 AM   #3
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
Yes, in exchange 2003 the linux server is granted the relay right.
 
Old 02-04-2009, 08:14 AM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by TalkingMarble View Post
Yes, in exchange 2003 the linux server is granted the relay right.
Sorry about that I just reread your post and seen that you have that in there. Hmmm... Ok a couple of things to run. First run
Code:
postmap transport
and then restart postfix. Also try to telnet from your postfix box to the mail server and send an email from the command line. Just helps to start taking somethings out of the equation. I remember I had troubles on my debian postfix box and I think this was the same problem. Also forgot to mention did you create a transport file?

Last edited by jstephens84; 02-04-2009 at 08:15 AM.
 
Old 02-05-2009, 01:32 AM   #5
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
I ran "postmap transport" and restarted postfix. In my case the transport file was create by the installation of postfix. I already made the following entry in the transport file: * smtp:ipaddress exchange server. I was succesful to send a mail to my own mailacount by using the telnet method.

However, to send a mail by a script still does not work.
 
Old 02-05-2009, 04:10 AM   #6
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
I solved the problem. A newbie mistake. It seemed the linux server was configured without any nameservers being specified in resolv.conf.

Thanks for all the help.

Last edited by TalkingMarble; 02-05-2009 at 04:11 AM.
 
Old 02-05-2009, 08:17 AM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
doh, stupid dns. Why didn't I think of that. Oh well glad to hear you got it up and running.
 
Old 06-05-2009, 07:26 AM   #8
robertwolfe
Member
 
Registered: Apr 2005
Location: Grand Island, NY
Distribution: Ubuntu and Debian
Posts: 57

Rep: Reputation: 16
Quote:
Originally Posted by TalkingMarble View Post
Hi,

I'm new to linux/postfix, and would like some help with relaying/forwarding mail from a linux standalone server to our corporate mail environment (exchange 2003).
While not a newbie myself to Linux or Windows or Exchange 2003, I seem to be having an issue.

I have a CentOS 5.3 server set up as you described in your posting. Mail gets forwarded to the Exchange box like it should with one exception. Mail from one domain apparently gets delivered to the Exchange Server machine ok after being scanned by amavis-new, but when I go to log into a certain mailbox on the Exchange server, the message is not in the inbox folder, nor is there any logging of the connection attempt. It seems that emails from other domains get relayed fine (with the exclusion of spam and virii). If anyone has any experience with this issue and has a possible solution, I would be thankful for any assistance I can get with this.

TIA!
 
Old 06-06-2009, 04:43 AM   #9
TalkingMarble
Member
 
Registered: May 2008
Location: Deventer, The Netherlands
Distribution: CentOS 5.0
Posts: 50

Original Poster
Rep: Reputation: 17
I don't know if you already tried this, but maybe you can test the relaying to exchange manually. The included link describes a procedure how this can be done (http://www.auditmypc.com/freescan/readingroom/relay.asp).

I remember that i solved my problem, because i accidentally found some emails in the mailbox on linux describing the reason why the message could not be delivered. I my case that were the missing nameservers.
 
  


Reply



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
Postfix - Configuration to Forward Outgoing Mail Elsewhere Ruler2112 Linux - Server 7 09-15-2008 04:55 PM
how to forward mail to postfix virtual user justkeny2k Linux - Networking 7 12-22-2006 12:43 AM
Postfix forward mail rickylim Linux - Server 1 10-25-2006 10:41 PM
Postfix: Need to deliver all local mail to 1 account, then forward OneBinary Linux - Software 3 01-05-2006 04:49 PM
Postfix forward all inbound mail to another server bourbon_beast Linux - Software 2 06-28-2005 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:34 PM.

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