[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2008-10-07
19
Medium Priority
?
978 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
16 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Phishing emails are a popular malware delivery vehicle for attack.  While there are many ways for an attacker to increase the chances of success for their phishing emails, one of the most effective methods involves spoofing the message to appear to …
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
Suggested Courses
Course of the Month19 days, 9 hours left to enroll

872 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