summaryrefslogtreecommitdiffstats
path: root/kmail/kmcomposewin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmcomposewin.cpp')
-rw-r--r--kmail/kmcomposewin.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp
index d7e96b26..27a76c72 100644
--- a/kmail/kmcomposewin.cpp
+++ b/kmail/kmcomposewin.cpp
@@ -1980,8 +1980,23 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign,
TQString transport = newMsg->headerField("X-KMail-Transport");
const bool stickyTransport = mBtnTransport->isChecked() && !mIgnoreStickyFields;
- if (!stickyTransport && !transport.isEmpty())
+ if (!stickyTransport && !transport.isEmpty()) {
setTransport( transport );
+ }
+
+ // If we are using the default transport, and the originating account name of the original message matches the name of a valid transport, use setTransport() to set it
+ // See Bug 1239
+ if (transport.isEmpty() && !mMsg->originatingAccountName().isEmpty()) {
+ TQString transportCandidate = mMsg->originatingAccountName();
+ bool transportFound = false;
+ for ( int i = 0; i < mTransport->count(); ++i ) {
+ if ( mTransport->text(i) == transportCandidate ) {
+ transportFound = true;
+ setTransport(transportCandidate);
+ break;
+ }
+ }
+ }
if (!mBtnFcc->isChecked())
{