Solved

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

Posted on 2008-10-07
19
949 Views
Last Modified: 2013-12-17
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
0
Comment
Question by:hansel_l
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
19 Comments
 
LVL 19

Expert Comment

by:jools
ID: 22658795
can you add it to the local hosts file (/etc/hosts)
0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22658935
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
 

Author Comment

by:hansel_l
ID: 22659019
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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 

Author Comment

by:hansel_l
ID: 22659072
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22659176
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
 

Author Comment

by:hansel_l
ID: 22665990
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667158
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667232
sorry you dont need this line

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

Author Comment

by:hansel_l
ID: 22667367
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667385
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
 

Author Comment

by:hansel_l
ID: 22667400
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
 
LVL 29

Accepted Solution

by:
fosiul01 earned 500 total points
ID: 22667493
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667505
wait let me check something, if i can change the return path via php
0
 

Author Comment

by:hansel_l
ID: 22667531
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
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667541
you mean, changing the return path is not it ??

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22667656
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

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve DNS query failed errors for Exchange
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question