Solved

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

Posted on 2008-10-07
19
944 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 

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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RHEL6 + dockers - No route to host 7 98
VB.Net creating Contact in Outlook 1 94
Exchange 2016 Hybrid Server Specs and Roles 1 52
ifconfig related commands 6 18
Resolve DNS query failed errors for Exchange
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

739 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