RedHat, Enterprise Linux, Version 5, External SMTP Sendmail Configuration

Hi !
We have a Redhat Linux Enterprise version 5.0 webserver hostname zzz at www.xxx123.com. We also have an email server mail1.xxx123.com located at a different location. We are running a PHP application which uses sendmail to send out email from a feedback page. Some email servers check the message header which states apache@zzz.xxx123.com. The foreign mail servers find that zzz.xxx123.com is not a vaild DNS name.

For reasons which I cannot explain here I cannot create a DNS entry for zzz.xxx123.com.

I would like the webserver to send out emails using the mail server mail1.xxx123.com so that message headers only bear the name mail1.xxx123.com

All help apreciated

Thanks
hansel_lAsked:
Who is Participating?
 
fosiul01Connect With a Mentor Commented:
ommmm what you are trying to do, as far i belive it might not work

let me explian to you, if it make sense to you.

if you do  a Dns check of your domain you will see.

mx record for your domain is mail1.yourdomain.come and IP suppose  187.125.365.5

so any email going via your mailserver mail1 would be attached to that IP

now when you are sending email via your webserver ( i undestand it has sendmail setup aswell, and it might be VPS server) it has his own IP which is not same as your mail1.yourdomain.com

here its the problem,
you would be able to send mail from your webserver via mail1.yourdomain.com only if webserver is in same network. Since its not in same network, i belive, it would not happended,  unless there is any speical dns settings which i am not aware of.
0
 
joolsCommented:
can you add it to the local hosts file (/etc/hosts)
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
Is this something you are trying to do...

How to Configure PHP to Use a Remote SMTP Server for Sending Mail
http://email.about.com/cs/phpemailtips/qt/et021802.htm
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
hansel_lAuthor Commented:
Hi  mwcomputers
Will check with the developers. Was told that this can be set only in the PHP windows version and not the linux version
0
 
hansel_lAuthor Commented:
Hi Mwecomputers

The link you sent also states that it is applicable only for Windows

Quote - Note that setting up the internal mail function to use SMTP is only available on Windows - Unquote
0
 
fosiul01Commented:
HI ya
first of all,



from your question i dont understand , is your php application running  in the mail server ??

or you have a webserver (a)where php is running but you have another mailserver (B) and you are trying to send email from A by using B ??
0
 
hansel_lAuthor Commented:
Hi Fosiul01
The Mail server is a different server mail1. running a Windows OS with mdameon

The webserver is a Redhat Linux Enterprise server 5.0 which has the PHP application. Visitors to the site can submit a feedback form and the PHP app sends an auto-reply to them. When the visitors mail server receives the mail it shows as being received from the webserver whereas we want the header to show that the mail is coming from the mailserver.

0
 
fosiul01Commented:
ok , if your webserver and mailserver is in same network then you need to change sendmail.mc configuration to like this :

define(`SMART_HOST',`mail1.123xxxyourdomain.local')dnl

and MASQUERADE_AS(`mydomain.com')dnl MASQUERADE_AS(`123yourdomain.com')dnl


let me know what is outcomes from this
0
 
fosiul01Commented:
sorry you dont need this line

and MASQUERADE_AS(`mydomain.com')dnl MASQUERADE_AS(`123yourdomain.com')dnl
0
 
hansel_lAuthor Commented:
Hi fosiul01
I have tried that but i did not add the dnl at the end. I will try it with the dnl at the end. Does sendmail.cf need to be recompiled with the m4 command or can we just restart sendmail.
Secondly the two servers are not on the same LAN. In fact they are at different locations but both can be reached through a public IP
0
 
fosiul01Commented:
no then the concecpt i gave you it will not work!!!

to work on my concept both server will have to have in same network.

whats is in your /etc/hosts ??
0
 
hansel_lAuthor Commented:
Hi fosiul01
127.0.0.1            zzz.xxx123.com zzz localhost.localdomain localhost
::1            localhost6.localdomain6 localhost6

rest is in #
replaced actual names with zzz xxx & 123
0
 
fosiul01Commented:
wait let me check something, if i can change the return path via php
0
 
hansel_lAuthor Commented:
Thanks fosiul01.
I undertsand the problem fully but  think there shoudl be a solution as this is possibel in a Windows environment as suggested bymwecomputers. I am not sure how to do it in Linux.
0
 
fosiul01Commented:
you mean, changing the return path is not it ??

0
 
fosiul01Commented:
i was doing some investigation

check the bollow code :

<?php
$message =" Hi";
$to="fosiul@yourdomain.com";
$subject="return path";
mail($to,$subject,$message,$headers,"-ffosiul@yourdomain.co.uk");

?>

by using this simple code, you would be able to change the return path what ever you want

but chagne your /etc/hosts to zzz   zzz.yourdomain.com
0
All Courses

From novice to tech pro — start learning today.