Page 1 of 1

Return-Path

Posted: Thu Jan 17, 2008 3:46 pm
by meti_alb
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:

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>
Chris Corbyn | Please use

Code: Select all

tags when posted formatted code like the email source[/b][/color]

Re: Return-Path

Posted: Thu Jan 17, 2008 4:53 pm
by Chris Corbyn
RFC 2822:

Code: Select all

trace           =       [return]
                        1*received
That basically says one or no return path headers in the email.

Swift certainly isn't adding more than one so one of the intermediate servers must be.

I know Gmail rewrites the Sender header but I've never heard of it interfering with the Return-Path header since that's illegal (all Trace fields - i.e. Return-Path + Received) should never be modified.

EDIT | And yes, it will affect the spam score... probably very significantly.

Re: Return-Path

Posted: Thu Jan 17, 2008 4:59 pm
by Chris Corbyn
Something really weird has gone one with that email :? Received: headers should be "prepended" to the email, and this seems to have been passed around various Google servers, all of which have written a Return-Path header too... the completely bizarre thing is that not all of the Return-Path headers even match.

Are you sending from a *real* email address which does exist? i.e. does the return-path exist?

Re: Return-Path

Posted: Thu Jan 17, 2008 11:30 pm
by meti_alb
yes that is right,
both addresses exist I don't know if it is my hosting that creates the problem
but I think I am liking swiftmailer a lot and I want to stick with it....but Ihave to solve this first and my knowledge is for sure way smaller than yours in this.

I actually just tested it with a real gmail account (not just one using google MXs) and still the same result. 3 return paths

And I just remembered that all my tests passed when installing and I just checked one of them (smoke test 2) . Same Again.The following is the full header for that email:

Code: Select all

 
Delivered-To: metialb(at)gmail.com
Received: by 10.142.153.12 with SMTP id a12cs258776wfe;
        Tue, 15 Jan 2008 13:18:52 -0800 (PST)
Received: by 10.35.32.3 with SMTP id k3mr9740691pyj.18.1200431931343;
        Tue, 15 Jan 2008 13:18:51 -0800 (PST)
Return-Path: <cont(at)maasbesa.org>
Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177])
        by mx.google.com with ESMTP id n67si25975817pyh.8.2008.01.15.13.18.50;
        Tue, 15 Jan 2008 13:18:51 -0800 (PST)
Received-SPF: neutral (google.com: 64.233.166.177 is neither permitted nor denied by best guess record for domain of cont(at)maasbesa.org) client-ip=64.233.166.177;
Authentication-Results: mx.google.com; spf=neutral (google.com: 64.233.166.177 is neither permitted nor denied by best guess record for domain of cont(at)maasbesa.org) smtp.mail=cont(at)maasbesa.org
Received: by py-out-1112.google.com with SMTP id p76so386pyb.2
        for <metialb(at)gmail.com>; Tue, 15 Jan 2008 13:18:50 -0800 (PST)
Received: by 10.35.10.13 with SMTP id n13mr9725234pyi.29.1200431929910;
        Tue, 15 Jan 2008 13:18:49 -0800 (PST)
Return-Path: <cont(at)maasbesa.org>
Received: from ?76.163.248.2? ( [76.163.252.84])
        by mx.google.com with ESMTPS id w29sm10447725pyg.40.2008.01.15.13.18.46
        (version=SSLv3 cipher=OTHER);
        Tue, 15 Jan 2008 13:18:48 -0800 (PST)
Return-Path: <cont(at)maasbesa.org>
To: Meti Permeti <metialb(at)gmail.com>
From: MAASBESA <cont(at)maasbesa.org>
Reply-To: MAASBESA <cont(at)maasbesa.org>
Subject: Smoke Test 2 - Multipart
Date: Tue, 15 Jan 2008 15:14:54 -0600
X-LibVersion: 3.3.2
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="_=_swift-838144799478d22503dc452.13538871_=_"
Content-Transfer-Encoding: 7bit
Message-ID: <20080115211454.20770.1626228089.swift@maasbesa.org>
 
This is a message in multipart MIME format.  Your mail client should not
be displaying this. Consider upgrading your mail client to view this
message correctly.
--_=_swift-838144799478d22503dc452.13538871_=_
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
 
This message was sent in plain text
--_=_swift-838144799478d22503dc452.13538871_=_
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
 
This message was sent in <strong>HTML</strong>
--_=_swift-838144799478d22503dc452.13538871_=_--