PDA

View Full Version : Sendmail Query - PHP script


tech_paul
1st September 2009, 20:42
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

id10t
1st September 2009, 21:31
mx record, local domains, etc. will depend on what SMTP server you have on the webserver...

tech_paul
2nd September 2009, 08:09
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

id10t
2nd September 2009, 15:16
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...

tech_paul
3rd September 2009, 09:37
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?

falko
3rd September 2009, 16:50
What's the output of ls -la /etc/mail/?

tech_paul
4th September 2009, 07:59
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

falko
4th September 2009, 18:42
Is the domain listed in /etc/mail/local-host-names? If so, remove it and restart Sendmail.

tech_paul
4th September 2009, 21:43
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

falko
5th September 2009, 14:51
I've done this with Postfix, but not Sendmail...

tech_paul
5th September 2009, 16:02
Hi Folko,

If you can tell me which main parts I need to configuring on postfix and how, maybe I can adopt it to sendmail. I will try to find similar config. I believe they are very similar right?

Paul

falko
6th September 2009, 16:48
No, unfortunately you can't compare Sendmail and Postfix configuration - they are very different (and Sendmail is a nightmare to configure...).