Version: (using KDE Devel) Installed from: Compiled sources When Forwarding Redirect an email it will be sent to sender not to specified "To " email address.
I think the Novell bugreport 72040 is about the same issue: I tried to "redirect" an email. My sending settings were incorrect, so the send failed, and the email was placed in "outbox" for future delivery. The problem was that the email in outbox contained all of the original "To:", "CC", and "BCC" fields. So, when the outgoing mail server settings were fixed, and the mail sent, it went out to all the original recipients, not the person I attempted to "redirect" to. This should be fixed somehow so that the mail is stored in "outbox" in such a way that when it is delivered, it only goes to the "redirect" recipient. Ananlysis: The internal "X-KMail-Recipients" header is removed before sending but should be restored when sending fails, see e.g. KMSendSMTP::send but other send() methods may be affected too.
Andreas: according to Till you are into this stuff?
Confirmed. A patch has been sent to the developer mailing list for further discussion.
Created attachment 10096 [details] proposed fix Please try whether this patch fixes the problem.
I'm afraid it doesn't fix the problem .. It's the same as before: My reproduction way is this: I have an email which I got from a guy who has a kind of mailing list and who has the same address in HIS to line as in his sender address. Then I try to redirect it to a good friend of mine - but I fail to authenticate with my pop account correctly: The mail stays in my outgoing folder and has as TO address the original sender address and not the TO address I had specified. Additionally to that I noticed, that if I authenticate correctly to my account I get an error because the sender address is not mine but the original sender address ....
Hmm, I guess I have to explain what redirect is supposed to do. Redirect sends the message exactly as it was received to another address. A few Resent-* headers are added to the message, but neither the To address nor the From address nor any other header is changed. This is the recommended way (as per RFC 2822) to do this. It seems your email provider (GMX?) only allows you to send messages with your address as sender address. In this case you can't use redirect. You'll have to use forward instead. Alternatively, you can mark the message as sent and then use Send Again and change the From address. Please, note that the fact that you can't use redirect is not due to a bug in KMail, but due to your email provider restricting which messages you are allowed to send. Maybe you can use another SMTP server instead, e.g. the SMTP server of your internet provider.
Created attachment 10125 [details] Header of the (not yet) redirected email - patch to kmsender.cpp applied
Ok, thx for the explanation (I didn't think that the server refuses my redirection is a bug in kmail, but I thought kmail should change the "From" header to my address ..) - but does that mean that if I try to redirect, via an another smtp server, the To address wouldn't be changed but an extra header (not visible without looking at the "email-code") would be inserted and the smtp server would this header interpret correctly ? If that's the case kmail should show the "correct" (the address that the email is really sent to..) To address when you keep your email in the outgoing folder and you edit it later ... Well I'm really not sure if I understood that whole thing correctly - so perhaps posting the email header helps. For security reason I removed some unnecessary details and wrote a [edited] or smth. similar instead of it.
CVS commit by gungl: Don't let KMail forget the "X-KMail-Recipients" header if sending of messages failed (Patch by Ingo Klöcker) BUGS: 101190 M +9 -0 kmsender.cpp 1.227 --- kdepim/kmail/kmsender.cpp #1.226:1.227 @@ -514,4 +514,7 @@ void KMSender::doSendMsgAux() if (!mSendProc->send(mCurrentMsg)) { + mCurrentMsg->setTransferInProgress( false ); + mOutboxFolder->unGetMsg( mFailedMessages ); + mCurrentMsg = 0; cleanup(); setStatusMsg(i18n("Failed to send (some) queued messages.")); @@ -586,4 +589,9 @@ void KMSender::slotIdle() if (mSendAborted) { // sending of message aborted + if ( mCurrentMsg ) { + mCurrentMsg->setTransferInProgress( false ); + mOutboxFolder->unGetMsg( mFailedMessages ); + mCurrentMsg = 0; + } msg = i18n("Sending aborted:\n%1\n" "The message will stay in the 'outbox' folder until you either " @@ -598,4 +606,5 @@ void KMSender::slotIdle() if (!mSendProc->sendOk()) { mCurrentMsg->setTransferInProgress( false ); + mOutboxFolder->unGetMsg( mFailedMessages ); mCurrentMsg = 0; mFailedMessages++;
The real problem as described in comment #1 is fixed. Thanks, Ingo, for your improvement. Thomas, dealing with the SMTP server is unrelated. Thanks for reporting though, so we came across the bug in the background.
Re #8: The SMTP server is told by KMail which address(es) the message should be sent to. The server doesn't need to parse the header. If you edit a redirected message in the outbox then the information about the redirect address will be lost. The question is whether this is a bug or not. A redirected message should be sent as-is. It should not be editted. I think when the user tries to edit a redirected message then the dialog for the redirect address should be shown and allow the user to change this address. (Andreas, would you mind looking into this?) If the user wants to add some comments to a "redirected" message then he should forward the message.