How do I modify the SMTP return-path for individual accounts on a VPS

Avatar
  • Answered
When email sent from one of the accounts on our VPS the SMTP return path is set to username@vpsdomainname. eg. the email is sent from account whitsail that has the domain name whitsailing.com. The Return-Path is set to [email protected].

This causes a lot of servers to reject our email. We need to set the Return-Path to an email address in the "from" domain.

It is not possible to set this header through normal programming (as I was told when I contacted support online). I believe that is is in the sendmail/php.ini but I'm not 100% sure.

How can we set this header and others that need modifying on an account basis?

Below are the headers from a test message. Ideally everywhere that has wsa.wsahosting.com should be whitsailing.com, but the minimum is the Return-Path.

Delivered-To: [email protected]
Received: by 10.194.29.234 with SMTP id n10csp1415wjh;
Thu, 17 May 2012 17:01:23 -0700 (PDT)
Received: by 10.68.132.166 with SMTP id ov6mr19422054pbb.24.1337299283052;
Thu, 17 May 2012 17:01:23 -0700 (PDT)
Return-Path:
Received: from eros.lunarpages.com (eros.lunarpages.com. [67.210.124.30])
by mx.google.com with ESMTPS id vn7si13504989pbc.191.2012.05.17.17.01.22
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 17 May 2012 17:01:23 -0700 (PDT)
Received-SPF: neutral (google.com: 67.210.124.30 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=67.210.124.30;
Authentication-Results: mx.google.com; spf=neutral (google.com: 67.210.124.30 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Received: from vps4155.inmotionhosting.com ([74.124.200.106]:50339 helo=wsahost.wsahosting.com)
by eros.lunarpages.com with esmtps (TLSv1:AES256-SHA:256)
(Exim 4.77)
(envelope-from )
id 1SVAdE-0000Bo-2H
for [email protected]; Thu, 17 May 2012 17:01:20 -0700
Received: from whitsail by wsahost.wsahosting.com with local (Exim 4.69)
(envelope-from )
id 1SVAdF-0005nG-6B; Fri, 18 May 2012 10:01:21 +1000
To: [email protected], [email protected]
Subject: Availability - Friday 18th May - Morning
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="=_4cd0dbdadf3ac3e93d48e7e4bc735790"
From: Whitsundays Sailing Adventures Reservations
Reply-To: Whitsundays Sailing Adventures Reservations
Message-Id:
Date: Fri, 18 May 2012 10:01:21 +1000
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - wsahost.wsahosting.com
X-AntiAbuse: Original Domain - mskiana.com
X-AntiAbuse: Originator/Caller UID/GID - [502 32003] / [47 12]
X-AntiAbuse: Sender Address Domain - wsahost.wsahosting.com
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php /home/whitsail/public_html/agents/mailman_select_list_for_availability.php
X-Source-Dir: whitsailing.com:/public_html/agents
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - eros.lunarpages.com
X-AntiAbuse: Original Domain - mskiana.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - wsahost.wsahosting.com
X-Source:
X-Source-Args:
X-Source-Dir:
Avatar
Scott
Hello WSAGreg, Thank you for your question to us. The Return Path can be controlled and changed by adding a fifth parameter to the mail() function. You would set that to: "-f [email protected]" so a sample function call would look like this: mail( "John Doe ”, “Hello World”, $message, “From: Jane Doe ”, “-f [email protected]” ); I hope this helps answer your question. If you have any further questions or information on the issue, please comment below so we can assist you further. Thank You, - Scott M