The "Return-Path" header is not showing the one that i gave in the code. Its showing some garbled text which is different from the original. Its working fine in my demo server, but not in the live one. Im not using smtp. this is the plain php script that im running $bounce = [bounce mail id]; $reply = [reply mail id]; $headers="MIME-Version: 1.0\n"; $headers.="Content-type: text/html; charset=iso-8859-1\n"; $headers.="From:<$reply>\r\nReply-To:$reply\r\nReturn-Path:$bounce\r\nReturn-Receipt-To:$bounc\r\nX-Mailer: PHP\n"; mail('my_id@gmail.com','test mail from live server','hello Pratip',$headers); now we expect the return path to be the bounce mail id after receiving this mail. But its showing something else. Thats what creating a problem when im trying to track bounce mails from my website. As i told, the same code is running fine in my test server but not in the demo server....... Hope u guys understand. Please help.........
Some server did not support "Return-Path" in headers, you have to use $additional_parameters with "-f" command in mail() function instead. So try this: mail('my_id@gmail.com','test mail from live server','hello Pratip',$headers,'-f'. $bounce); PHP: You can find some example on php mail() page. Hope this helps.
Just for some more informations here are the full headers(show original) that comes in gmail : Demo Server : Delivered-To: pratip17.ghosh@gmail.com Received: by 10.142.116.21 with SMTP id o21cs1103991wfc; Mon, 28 Dec 2009 20:59:28 -0800 (PST) Received: by 10.224.105.234 with SMTP id u42mr7914229qao.161.1262062767875; Mon, 28 Dec 2009 20:59:27 -0800 (PST) Return-Path: <test@clickedeals.com> Received: from clickedeals.com (ec2-174-129-248-51.compute-1.amazonaws.com [174.129.248.51]) by mx.google.com with ESMTP id 8si18560965qyk.124.2009.12.28.20.59.27; Mon, 28 Dec 2009 20:59:27 -0800 (PST) Received-SPF: neutral (google.com: 174.129.248.51 is neither permitted nor denied by best guess record for domain of test@clickedeals.com) client-ip=174.129.248.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 174.129.248.51 is neither permitted nor denied by best guess record for domain of test@clickedeals.com) smtp.mail=test@clickedeals.com Received: (qmail 2820 invoked by uid 48); 28 Dec 2009 23:59:27 -0500 Date: 28 Dec 2009 23:59:27 -0500 Message-ID: <20091229045927.2818.qmail@clickedeals.com> To: pratip17.ghosh@gmail.com, pratip07.ghosh@gmail.com Subject: test mail MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 From: Pratip Ghosh <pratip@navsoft.in> Reply-To: pratip@navsoft.in Return-Receipt-To: test@clickedeals.com Mailed-By: noreply@clickedeals.com X-Mailer: PHP checking for bounced mails Live Server : Delivered-To: pratip17.ghosh@gmail.com Received: by 10.142.116.21 with SMTP id o21cs1103923wfc; Mon, 28 Dec 2009 20:57:54 -0800 (PST) Received: by 10.220.122.213 with SMTP id m21mr8854200vcr.86.1262062673425; Mon, 28 Dec 2009 20:57:53 -0800 (PST) Return-Path: <40e.10.pratip17.ghosh=gmail.com@smtp-od.com> Received: from mail5.smtp-od.com (mail5.smtp-od.com [204.232.180.115]) by mx.google.com with ESMTP id 3si20639247vws.132.2009.12.28.20.57.52; Mon, 28 Dec 2009 20:57:52 -0800 (PST) Received-SPF: pass (google.com: domain of 40e.10.pratip17.ghosh=gmail.com@smtp-od.com designates 204.232.180.115 as permitted sender) client-ip=204.232.180.115; Authentication-Results: mx.google.com; spf=pass (google.com: domain of 40e.10.pratip17.ghosh=gmail.com@smtp-od.com designates 204.232.180.115 as permitted sender) smtp.mail=40e.10.pratip17.ghosh=gmail.com@smtp-od.com; dkim=hardfail header.i=@smtp-od.com DKIM-Signature: v=1; a=rsa-sha1; d=smtp-od.com;i=@smtp-od.com;s=key1038; c=relaxed/relaxed; q=dns/txt; t=1262062672; x=1264654672; h=x-thread-info:received:received:date:message-id:to:subject:mime-version:content-type:from:reply-to:return-receipt-to:mailed-by:x-mailer; bh=pxNcpVZ2+9gjV1lekZlLLF45/xQ=; b=uXXb1WY8Dzt3NUb762FWdwHhZQeP9ZKRffe74f7YcOCTyIGg5Ezsya2feiV/6NGbsb0P1RXkq6lEQcPvLHtl4VaiP24GvNdzNlFKFzZL2S/hFG6wWJMQgCc9HE0O37BimXm0fDER/WpvVrcb7wrPla0CyDNYCTjxoVL6/wiIH3s= X-Thread-Info: NDBlLjEyLjhlMDAwMDAwMDE2YjFhLnByYXRpcDE3Lmdob3NoPWdtYWlsLmNvbQ== Received: from 69-64-75-101.dedicated.abac.net (mail.clickedeals.com [69.64.75.101]) by mail4.email-od.com with ESMTP; Mon, 28 Dec 2009 23:57:51 -0500 Received: (qmail 11701 invoked by uid 48); 28 Dec 2009 20:59:24 -0800 Date: 28 Dec 2009 20:59:24 -0800 Message-ID: <20091229045924.11699.qmail@69-64-75-101.dedicated.abac.net> To: pratip17.ghosh@gmail.com, pratip07.ghosh@gmail.com Subject: test mail MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 From: Pratip Ghosh <pratip@navsoft.in> Reply-To: pratip@navsoft.in Return-Receipt-To: test@clickedeals.com Mailed-By: noreply@clickedeals.com X-Mailer: PHP checking for bounced mails Note the differences between "Return-Path:" parameter in the two headers. Hope this info helps more..................
As it turned out finally, i was very wrong from my first post My demo server was never using the mail server, only my live server was using it. And the mail server was using VERP to convert my return path to those things. After they turned this service off at my request, the return path is coming fine.