Version: (using KDE KDE 3.4.0) Installed from: SuSE RPMs Reproducibility: Always Steps to reproduce: 1. Article->Post to Newsgroup. Article composer pops up. 2. Type in a newsgroup of your choice if KNode didn't already specify one. Leave the Subject field blank for now. 3. Enter some article text. 4. Using the keyboard, select and copy a line of text, including the newline, from the article body. That is, cursor to the beginning of a line of text, press Shift-Down, then Ctrl+Ins. 5. Cursor to the Subject field. 6. Paste your selected text with Shift+Ins. 7. File->Send Now Observed behaviour: After step 6, it is clear that KNode has pasted the newline into the Subject field, since there's an extra unprintable character at the end of the line. After step 7, KNode pops up an error dialog indicating the send failed. The error message listed is "441 Post rejected, formatting error: Missing Newsgroups: header" Expected behaviour: KNode should either silently strip any newlines from the Subject field, or warn the user when he attempts to send such a malformed Subject. The current error message is misleading as it does not give any indication of what is really wrong or how to fix the problem.
Created attachment 10845 [details] Screenshot showing described behaviour
Important note: because the Subject header's embedded newline is saved along with the message, this bug also causes corruption of the outbox folder. That is, KNode interprets the blank line as the end of the article headers and the beginning of the body. See attached screenshot.
Created attachment 10846 [details] Screenshot showing corrupted outbox
I wasn't able to reproduce the message corruption, but it's definitely a bug, I'll fix this.
SVN commit 414155 by vkrause: Remove newlines from the subject. CCBUG: 104788 M +10 -2 trunk/KDE/kdepim/knode/kncomposer.cpp --- trunk/KDE/kdepim/knode/kncomposer.cpp #414154:414155 @@ -1423,8 +1423,16 @@ void KNComposer::slotSubjectChanged(const QString &t) { - if(!t.isEmpty()) setCaption(t); - else setCaption(i18n("No Subject")); + // replace newlines + QString subject = t; + subject.replace( '\n', ' ' ); + subject.replace( '\r', ' ' ); + v_iew->s_ubject->setText( subject ); + // update caption + if( !subject.isEmpty() ) + setCaption( subject ); + else + setCaption( i18n("No Subject") ); }
SVN commit 414160 by vkrause: Backport from trunk: Remove newlines from the subject. BUG: 104788 M +10 -2 branches/KDE/3.4/kdepim/knode/kncomposer.cpp --- branches/KDE/3.4/kdepim/knode/kncomposer.cpp #414159:414160 @@ -1423,8 +1423,16 @@ void KNComposer::slotSubjectChanged(const QString &t) { - if(!t.isEmpty()) setCaption(t); - else setCaption(i18n("No Subject")); + // replace newlines + QString subject = t; + subject.replace( '\n', ' ' ); + subject.replace( '\r', ' ' ); + v_iew->s_ubject->setText( subject ); + // update caption + if( !subject.isEmpty() ) + setCaption( subject ); + else + setCaption( i18n("No Subject") ); }