LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Postfix: forward mail (https://www.linuxquestions.org/questions/linux-newbie-8/postfix-forward-mail-701846/)

TalkingMarble 02-03-2009 02:43 AM

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

jstephens84 02-03-2009 08:58 AM

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.

TalkingMarble 02-04-2009 01:01 AM

Yes, in exchange 2003 the linux server is granted the relay right.

jstephens84 02-04-2009 08:14 AM

Quote:

Originally Posted by TalkingMarble (Post 3431404)
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?

TalkingMarble 02-05-2009 01:32 AM

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.

TalkingMarble 02-05-2009 04:10 AM

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.

jstephens84 02-05-2009 08:17 AM

doh, stupid dns. Why didn't I think of that. Oh well glad to hear you got it up and running.

robertwolfe 06-05-2009 07:26 AM

Quote:

Originally Posted by TalkingMarble (Post 3429989)
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!

TalkingMarble 06-06-2009 04:43 AM

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.


All times are GMT -5. The time now is 09:24 AM.