Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

included is the header results form yahoo message. You will see if there that is has server.realcashback.com.au but I need it to not be and to be from my server, is there any way to make it send as my domain.com instead of the server. The domain I want it sending from is not on the same server.

I am using PHP

    From iNcard Thu Sep 15 20:25:29 2011
X-Apparently-To: russell.harrower@yahoo.com via 98.138.87.158; Thu, 15 Sep 2011 20:25:32 -0700
Return-Path: <icard-lifestyle-guide@incard.com.au>
Received-SPF: none (domain of incard.com.au does not designate permitted sender hosts)
X-YMailISG: lo3RhWoWLDv_WHz3JN9HmYtpybG2PDVs8qfPdALeMm06q6Va
 7_JLFvrtF3ZMrNnWTt.LFkzfH8epmIbIXDqmvgfBfiEV5bgtYB.7u4Ct17Dx
 gXTX0gNkH7_Ad9Im0fuFYp6bB1b8N4ymRJ86dFjEsCaEEwB7Q8_5cZzMZJW9
 gZcRui_aVjfybJxiClzRlb8xgCsOsf1qYjJx5dF__GX9UcZqIhC9XOQgj8bf
 VEQKZMSuXGT8TAblfeAE0V39fQEPOOjBEMzYYMf7Mch8jjD.RlV4IOBVPZBF
 jNAthv0bCKIQICb7JBEVe03A9C33MzIYyY_DlGugFBdr9I3r19PZKutv2Lsd
 e7FkpZ6li8rd3Em5wN3blqWGP.pgtxnOAw4klakMQbxQ9MuRPcvLoVT_G1Ab
 .eLzBJnHwojtG3.nsCahq1mxq88GsG9ZeAqaN74Fn1Cs8zGKx2dIndp_8lPt
 CH_M4q5DXvjpQmCszDbICAKXJFX9VaQFsjjOMUVwJemDlGlSm.N0xUb78MX7
 WFXZyht5tGLsuJcNR8qazP1DoHPt0Z4yKNE.SGOpCdV.aqyWaU3Z84rFodob
 aR0ZfXg411De2TyOw3G1d4OPIST_fNgVHslC1gaeGQc5jRQur37E.5J4cuYl
 PTKhZKh2WKjTACJaLauMzurW3da7f_46iurJLNm_kUfCbNUwjTjfcjfm7zcC
 CFYlgMQ.uwIyFEZ9wfTFMKhdktB1Pt6_OJZ2AMDgfVbkWsGhzSPpzGBW8wIN
 ObOPKdwaDDBgGHeBR2om9uTq1nL.O3KvX946mgYMhbcBdDQAXyiW.9I2882M
 6a.0YjE12tfEzrmYAWCijJQw7uOlfuDYsBO2FOEYRzfgvnHB5hoTHJb3NHz5
 3sIXnnIfAB6sbh7psVd9Hp.nE6bmaqQr4CubIWJanYv6.o5sxKBXVQEuHFTA
 3s0AAP3FlW8Qpsj_i2SybgmHBvFx_.a0sM2Qh6p3d0D7zQZLIwzYS0nA6wRL
 GtM_krFeie2fRApV7s.GIxyn2vauuypWFzF.vKRaxLLfsYnLljcOYy9EXeQC
 ahCxNHg9lppRMZNvPyTFBpcj1mle32pZkWE5HQyxr_aNnz3a69RPoBnQNvi3
 W4zl_CsWcBxqxSdA15i2Kkh0HDgO6THcfq1Vwaf89buHwqFo2RnRcumB1Q7W
 vRxBG9ci..an6iKSaPIGEvTOkwIhBbn17sL62hliHa6kVnnv5iIGdiPHZYxb
 BQh3oDtYkL8i.ICgkpQW4OCXj007fmizFgQvO1f1DYxAkbCbztbIHzzAv5Ae
 kQmxBYTDfOMUmfbU996gPH25NYiVuF1z_eY6CB0BFozwv7gnadJBfGhzi6H2
 XndEqKkhYXmSQ1.ixvAn78xYt8eJwi0C3Y0CRt5qbM84S0M0dbI-
X-Originating-IP: [173.199.158.72]
Authentication-Results: mta1011.mail.ac4.yahoo.com  from=host.realcashback.com.au; domainkeys=neutral (no sig);  from=incard.com.au; dkim=neutral (no sig)
Received: from 127.0.0.1  (EHLO host.realcashback.com.au) (173.199.158.72)
  by mta1011.mail.ac4.yahoo.com with SMTP; Thu, 15 Sep 2011 20:25:32 -0700
Received: from realcas by host.realcashback.com.au with local (Exim 4.69)
    (envelope-from <icard-lifestyle-guide@incard.com.au>)
    id 1R4P3R-0006qu-DD
    for russell.harrower@yahoo.com; Thu, 15 Sep 2011 22:25:29 -0500
To: russell.harrower@yahoo.com
Subject: iNcard Eftpos Lifestyle Guide
X-PHP-Script: realcashback.com.au/system/classes/core.php for 61.88.97.122
From: iNcard <russell.harrower@incard.com.au>
Reply-To: iNcard <russell.harrower@incard.com.au>
Message-ID:< icard-lifestyle-guide@incard.com.au>
X-Mailer: PHP v5.2.17
MIME-Version: 1.0
Content-Type: text/html; boundary="75434adf143cb37a87b1e10e2f08ffd4"
Sender:  <realcas@host.realcashback.com.au>
Date: Thu, 15 Sep 2011 22:25:29 -0500
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - host.realcashback.com.au
X-AntiAbuse: Original Domain - yahoo.com
X-AntiAbuse: Originator/Caller UID/GID - [500 32002] / [47 12]
X-AntiAbuse: Sender Address Domain - incard.com.au
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php /home/realcas/public_html/system/classes/core.php 
X-Source-Dir: realcashback.com.au:/public_html/system/classes
Content-Length: 8054

PHP CODE

public function sendemail($name, $whichemail, $emailaddress, $sender)
    {
        $this->whichemail = $whichemail;




        $getemail = mysql_query("SELECT * FROM sendemails WHERE id = '".$this->whichemail."'");

        $row = mysql_fetch_array($getemail);

//      print $row["typeid"];
        if (strtoupper(substr(PHP_OS,0,3)=='WIN')) { 
          $eol="\r\n"; 
        } elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) { 
          $eol="\r"; 
        } else { 
          $eol="\n"; 
        }
        $headers .= 'From: iNcard <'.$sender.'>'.$eol; 
        $headers .= 'Reply-To: iNcard <'.$sender.'>'.$eol; 
        $headers .= 'Return-Path: iNcard <'.$sender.'>'.$eol;     // these two to set reply address 
        $headers .= "Message-ID:<".$now." icard-lifestyle-guide@incard.com.au>".$eol; 
        $headers .= "X-Mailer: PHP v".phpversion().$eol;           // These two to help avoid spam-filters 
        # Boundry for marking the split & Multitype Headers 
        $mime_boundary=md5(time()); 
        $headers .= 'MIME-Version: 1.0'.$eol; 
        $headers .= "Content-Type: text/html; boundary=\"".$mime_boundary."\"".$eol; 

        $body = $row["html"];

        $correct = array($name, $emailaddress, $sender, "{$this->whichemail}");
        $wrong   = array("[name]","[sendTo]", "[sendFrom]", "[whatemail]");

        $newbody = str_replace($wrong, $correct, $body);

        mail($emailaddress, $row["subject"], $newbody, $headers,"-ficard-lifestyle-guide@incard.com.au");
    }
share|improve this question
    
Would be helpful to see the php code for sending this email. –  Alan Moore Sep 16 '11 at 3:34
    
it shows the from address is russell.harrower@incard.com.au is that the one it shouldn't be? –  thegaffney Sep 16 '11 at 3:37
    
Is your question How do I get Yahoo to not do a reverse dns lookup of the origin of an e-mail? You don't. That has nothing to do with programming. –  mootinator Sep 16 '11 at 3:41
    
yes but in outlook it says russell.harrower@incard.com.au via root@host.realcashback.com.au –  RussellHarrower Sep 16 '11 at 3:47
    
are you sending emails using some public mail server or your own mail server? –  thegaffney Sep 16 '11 at 3:53
add comment

migrated from stackoverflow.com Sep 16 '11 at 8:30

This question came from our site for professional and enthusiast programmers.

2 Answers

Some mail servers will add the Sender: header if the From: header doesn't match its understanding of the message's originator. If you have control over your site's Exim configuration, I believe you should be able to turn off this behavior.

If you also don't want to be visible in the Received: headers, you are most probably in for a bigger change in how you send email. One possibility would be to outsource message sending to a third party; depending on your reasons for wanting to do this, that may not be acceptable, either.

By the way, it's pointless to try to set Return-Path, as that will be set to your envelope sender at the receiving end. Perhaps there is a way to set the envelope sender from PHP, too (in which case I guess your Sender: problem could disappear, too).

share|improve this answer
    
Hmm, I guess that's the sendmail_from alluded to in @thegaffney's answer. –  tripleee Sep 16 '11 at 4:58
add comment

Ooo maybe I know what the problem is, the domain of the from address (incard.com.au) doesnt match the name of the server its being sent from (host.realcashback.com.au)

If the email address your trying to say its from doesn't match the server name, your email will most likely get marked as spam, and some clients, will show that the email really didnt come from a server called (incard.com.au) which is true in your case.

If you own incard.com.au then you need to change your nameservers to point all (or at least mail) traffic to the ip address that (host.realcashback.com.au) is on

If you already have done this, then your mail settings in your php.ini need to be changed to match the incard.com.au address

SMTP = incard.com.au
sendmail_from = admin@incard.com.au
share|improve this answer
    
I don't think DNS has a role in this; fixing the envelope sender should suffice, I believe. –  tripleee Sep 16 '11 at 5:06
    
@tripleee Yeah true, it might fix the problem of recieving the message, but what happens when someone replies to the email? If the domain incard.com.au has no public dns record then they are going to get a return-email with an error along the line of The destination server for this recipient could not be found in Domain Name Service (DNS). Please verify the email address and retry. –  thegaffney Sep 16 '11 at 5:24
    
While true, I don't think it has any bearing on the OP's problem. –  tripleee Sep 16 '11 at 5:53
    
its definitely going to be their next problem though :) But good point –  thegaffney Sep 16 '11 at 5:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.