Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st September 2009, 19:42
tech_paul tech_paul is offline
Junior Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
Default Sendmail Query - PHP script

Hi,

Scenario:

I have 2 servers, 1 webserver (incl. dns) and 1 mail server in the same network. In the webserver there is a PHP script that is sending e-mails (to an account on the mail server) but is sending them locally on the webserver and not to the mailbox on the mail server. The webserver is like, it does not know that it should NOT handle emails for that domain, but route it to the mail server (where the mailbox is).

If I set an external account (gmail etc..) that is not hosted on the webserver, it works fine. The problem is when I set the php script to send to an account from my mail server.

What can I set on the web server in order to route emails to the mail server please? Can this problem be solved please?

ANY HELP APPRECIATED!! Thanks in advanced
Reply With Quote
Sponsored Links
  #2  
Old 1st September 2009, 20:31
id10t id10t is offline
Senior Member
 
Join Date: Nov 2008
Posts: 240
Thanks: 2
Thanked 22 Times in 22 Posts
Default

mx record, local domains, etc. will depend on what SMTP server you have on the webserver...
Reply With Quote
  #3  
Old 2nd September 2009, 07:09
tech_paul tech_paul is offline
Junior Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Can you please elaborate what I need to do? I have mx records on the webserver that eventually they point to the mail server.

What do you mean by "depend on what SMTP server"? I have sendmail as an SMTP server.

Thanks for your reply
Reply With Quote
  #4  
Old 2nd September 2009, 14:16
id10t id10t is offline
Senior Member
 
Join Date: Nov 2008
Posts: 240
Thanks: 2
Thanked 22 Times in 22 Posts
Default

There may be something in the sendmail config on the webserver that tells it to deliver mail for your domain to users on that host, as opposed to sending it out to your real mail server...
Reply With Quote
  #5  
Old 3rd September 2009, 08:37
tech_paul tech_paul is offline
Junior Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks very much for your reply.

I have tried to set it as you told me but than no emails can be sent! Do I need to setup something on the mail server to accept the webserver to use its smtp pls?
Reply With Quote
  #6  
Old 3rd September 2009, 15:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

What's the output of
Code:
ls -la /etc/mail/
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 4th September 2009, 06:59
tech_paul tech_paul is offline
Junior Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Falko,

Please find the command ls -la /etc/mail on the webserver:

> ls -la /etc/mail/
total 360
drwxr-xr-x 3 root root 4096 Sep 3 09:04 .
drwxr-xr-x 104 root root 12288 Sep 4 04:05 ..
-rw-r--r-- 1 root root 1048 Mar 15 2007 Makefile
-rw-r--r-- 1 root root 355 Mar 15 2007 access
-rw-r----- 1 root root 12288 Sep 2 07:11 access.db
-rw-r--r-- 1 root root 0 Mar 15 2007 domaintable
-rw-r----- 1 root root 12288 Sep 2 07:11 domaintable.db
-rw-r--r-- 1 root root 5521 Mar 15 2007 helpfile
-rw-r--r-- 1 root root 64 Mar 15 2007 local-host-names
-rw-r--r-- 1 root root 32 Sep 1 14:36 local-host-names.rpmsave
-rw-r--r-- 1 root root 0 Mar 15 2007 mailertable
-rw-r----- 1 root root 12288 Sep 2 07:11 mailertable.db
-rw-r--r-- 1 root root 50 Sep 1 18:52 mailertable.rpmsave
-rw-r--r-- 1 root root 415 Sep 1 13:24 relay-domains
-rw-r--r-- 1 root root 58292 Sep 3 09:04 sendmail.cf
-rw-r--r-- 1 root root 58194 Sep 2 08:40 sendmail.cf.orig
-rw-r--r-- 1 root root 58284 Sep 1 18:49 sendmail.cf.rpmsave
-rw-r--r-- 1 root root 7198 Sep 3 07:59 sendmail.mc
-rw-r--r-- 1 root root 7227 Sep 1 18:49 sendmail.mc.rpmsave
drwxr-xr-x 2 root root 4096 Jul 17 16:53 spamassassin
-r--r--r-- 1 root root 41275 Mar 15 2007 submit.cf
-rw-r--r-- 1 root root 940 Mar 15 2007 submit.mc
-rw-r--r-- 1 root root 127 Mar 15 2007 trusted-users
-rw-r--r-- 1 root root 0 Mar 15 2007 virtusertable
-rw-r----- 1 root root 12288 Sep 2 07:11 virtusertable.db

Do you need the result of this command on the mail server?

Regards,

Paul
Reply With Quote
  #8  
Old 4th September 2009, 17:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Is the domain listed in /etc/mail/local-host-names? If so, remove it and restart Sendmail.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 4th September 2009, 20:43
tech_paul tech_paul is offline
Junior Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Folko,

That file is empty so there are no domains in this file. I have read something that I need to do the sendmail on the webserver to relay through the sendmail on the mail server.

Have you ever done this please? Or do you have any other suggestions?

Thanks for your help

Paul
Reply With Quote
  #10  
Old 5th September 2009, 13:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

I've done this with Postfix, but not Sendmail...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 13:06
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 10:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 11:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.