Return-Path
Posted: Thu Jan 17, 2008 3:46 pm
I have a question regarding the Return Path using swiftmailer with smtp to Gmail account.
The problem is that I get 3 Return-Paths on the emails I sent and I don't know if that causes any spam filters to filter the email....but I just have never seen an email with more than 1 Return-Path field in the header and I am not being able to fix it.
Code for sending the email:
So basically there are 2 email addresses used from me (recipients not included):
$settings->username (it's an account with different domain then gmail.com but using google MXs....let's say username@domain.com)
$settings->from_address (as a reply-to address, different from tthe above....let's say reply-to@domain.com)
But my header has 3 Return-Paths (2 set to the username and the last one set to the from address) ....would this cause any other mail servers to block my emails as spam??
Below is an instance of such header
Chris Corbyn | Please use
The problem is that I get 3 Return-Paths on the emails I sent and I don't know if that causes any spam filters to filter the email....but I just have never seen an email with more than 1 Return-Path field in the header and I am not being able to fix it.
Code for sending the email:
Code: Select all
$subject = $_POST['subject'];
$message = ereg_replace('\\\"', '"', $_POST['message']);
$query = "SELECT * FROM email_config";
$sql_result = mysql_query ( $query ) ;
$settings = mysql_fetch_object ( $sql_result );
$smtp = new Swift_Connection_SMTP($settings->smtp_host, Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS);
$query = "SELECT * FROM email_config";
$sql_result = mysql_query ( $query ) ;
$settings = mysql_fetch_object ( $sql_result );
$smtp->setUsername([b]$settings->username[/b]);
$smtp->setpassword($settings->password);
$swift = new Swift($smtp);
$swift->attachPlugin(new Swift_Plugin_AntiFlood(90, 10), "anti-flood");
//html and text
$mesazhi = new Swift_Message($subject);
$mesazhi->attach(new Swift_Message_Part(strip_tags($message)));
$mesazhi->attach(new Swift_Message_Part($message, 'text/html'));
$recipients = new Swift_RecipientList();
$query = "SELECT email FROM email_list";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$recipients->addTo($row['email']);
}
if ( $swift->batchSend($mesazhi, $recipients,new Swift_Address([b]$settings->from_address[/b], $settings->from_name) ) )
{
$swift->disconnect();
header("location: newsletter.php?msg=sentsuccess");
}
else
{
$swift->disconnect();
header("location: newsletter.php?msg=sentfail");
}So basically there are 2 email addresses used from me (recipients not included):
$settings->username (it's an account with different domain then gmail.com but using google MXs....let's say username@domain.com)
$settings->from_address (as a reply-to address, different from tthe above....let's say reply-to@domain.com)
But my header has 3 Return-Paths (2 set to the username and the last one set to the from address) ....would this cause any other mail servers to block my emails as spam??
Below is an instance of such header
Code: Select all
Delivered-To: someaddress@somedomain.com
Received: by 10.142.153.12 with SMTP id a12cs17376wfe;
Thu, 17 Jan 2008 13:14:47 -0800 (PST)
Received: by 10.35.127.9 with SMTP id e9mr2845048pyn.21.1200604487453;
Thu, 17 Jan 2008 13:14:47 -0800 (PST)
Return-Path: <[b]username@domain.com[/b]>
Received: from ro-out-1112.google.com (ro-out-1112.google.com [72.14.202.178])
by mx.google.com with ESMTP id w29si4225323pyg.40.2008.01.17.13.14.46;
Thu, 17 Jan 2008 13:14:47 -0800 (PST)
Received-SPF: pass (google.com: domain of [b]username@domain.com[/b] designates 72.14.202.178 as permitted sender) client-ip=72.14.202.178;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [b]username@domain.com[/b] designates 72.14.202.178 as permitted sender) smtp.mail=[b]username@domain.com[/b]
Received: by ro-out-1112.google.com with SMTP id k5so21142rog.7
for <someaddress@somedomain.com>; Thu, 17 Jan 2008 13:14:46 -0800 (PST)
Received: by 10.35.36.13 with SMTP id o13mr2849851pyj.17.1200604486542;
Thu, 17 Jan 2008 13:14:46 -0800 (PST)
Return-Path: <[b]username@domain.com[/b]>
Received: from ?76.163.248.2? ( [76.163.252.84])
by mx.google.com with ESMTPS id f60sm7267375pyh.14.2008.01.17.13.14.44
(version=SSLv3 cipher=OTHER);
Thu, 17 Jan 2008 13:14:46 -0800 (PST)
Return-Path: <[b]reply-to@domain.com[/b]>
To: someaddress@somedomain.com
From: SOMENAME <[b]username@domain.com[/b]>
Reply-To: SOMENAME <[b]reply-to@domain.com[/b]>
Subject: ok
Date: Thu, 17 Jan 2008 15:11:57 -0600
X-LibVersion: 3.3.2
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift-1890917217478fc49f3257f4.40149741_=_"
Content-Transfer-Encoding: 7bit
Message-ID: <20080117211201.25631.1076497766.swift@domain.com>Code: Select all
tags when posted formatted code like the email source[/b][/color]