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?
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).
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!
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?
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.