hansel_l
asked on
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
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
can you add it to the local hosts file (/etc/hosts)
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
How to Configure PHP to Use a Remote SMTP Server for Sending Mail
http://email.about.com/cs/phpemailtips/qt/et021802.htm
ASKER
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
Will check with the developers. Was told that this can be set only in the PHP windows version and not the linux version
ASKER
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
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
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 ??
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 ??
ASKER
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.
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.
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 .123xxxyou rdomain.lo cal')dnl
and MASQUERADE_AS(`mydomain.co m')dnl MASQUERADE_AS(`123yourdoma in.com')dn l
let me know what is outcomes from this
define(`SMART_HOST',`mail1
and MASQUERADE_AS(`mydomain.co
let me know what is outcomes from this
sorry you dont need this line
and MASQUERADE_AS(`mydomain.co m')dnl MASQUERADE_AS(`123yourdoma in.com')dn l
and MASQUERADE_AS(`mydomain.co
ASKER
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
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
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 ??
to work on my concept both server will have to have in same network.
whats is in your /etc/hosts ??
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wait let me check something, if i can change the return path via php
ASKER
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.
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.
you mean, changing the return path is not it ??
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
check the bollow code :
<?php
$message =" Hi";
$to="fosiul@yourdomain.com
$subject="return path";
mail($to,$subject,$message
?>
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