strange MAIL FROM behaviour

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
Krishan
Forum Newbie
Posts: 5
Joined: Fri Aug 31, 2007 9:17 am

strange MAIL FROM behaviour

Post by Krishan »

When I want to send an e-mail the class returns the following error:

Code: Select all

Expected response code(s) [250] but got response [550 5.7.0 Sender address does not belong to logged in user {mp004}]
I verified, that the address indead is correct. I found out that swift->send uses the following command for setting the mail from command:

Code: Select all

$this->command("MAIL FROM: " . $message->getReturnPath(true), 250);
Here you see that not FROM is used as the address (what I would expect) but the RETURN-PATH address. As this address might be a complete different address as the from one (and I want it to be different!) this results in the mentioned error.

Is it a bug? Or correctly implemented and I have a thinking error?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

It's not a bug, the Return-Path is the "true" address you send emails from and the one spam checkers (and your server) pay particular attention to. The From: address is much less significant than the return-path because it doesn't generally affect innocent people like the Return-path address (spammers send emails with a return-path of someone else so that the other poor person gets a load of delivery failures in their inbox).
Krishan
Forum Newbie
Posts: 5
Joined: Fri Aug 31, 2007 9:17 am

Post by Krishan »

OK, then I have to verify, that the return-path address is part of the same account as the logged in user if I set it different from the normal from address. Hmm, thanks for the info. I will play around a bit to see what I can do with this behaviour. Thanks anyways!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

The way this has been implemented is according to RFC2821/2 (I forget which). The Return-Path header itself is not actually needed most of the time because the MAIL FROM command is what specifies the return-path (sender envelope). It's not something that I could physically change without going against the standards and if I did, the Return-Path you're setting would not do what you want it to do ;)

EDIT | Are you using Return-Path for bounce detection?
Krishan
Forum Newbie
Posts: 5
Joined: Fri Aug 31, 2007 9:17 am

Post by Krishan »

d11wtq wrote:The way this has been implemented is according to RFC2821/2 (I forget which). The Return-Path header itself is not actually needed most of the time because the MAIL FROM command is what specifies the return-path (sender envelope). It's not something that I could physically change without going against the standards and if I did, the Return-Path you're setting would not do what you want it to do ;)
Yes, I understood this. It's correct that you implement the standard. That's what I expect. What I did not expect is that the return path is the real sender and not the from address. But that are inconsistencies of the standard and not your fault.

EDIT | Are you using Return-Path for bounce detection?
Yes, that's what I want to do. And I wanteto send bouncing mails to a different mail account but this is not working this way. I'll use a different mail address of the same account now and forward incoming mails for this address to the other account.
Post Reply