--Boundary-00=_fXQLFHKPwhj2Yyv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I've come across this issue and found it unimplemented. Attached is the patch for the 3.5 branch. Please review. If nobody objects until Friday morning, I'll commit the change and port it to trunk. Andreas --Boundary-00=_fXQLFHKPwhj2Yyv Content-Type: text/x-diff; charset="us-ascii"; name="kmail-header-arguments.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmail-header-arguments.diff" Index: kmkernel.cpp =================================================================== --- kmkernel.cpp (revision 593826) +++ kmkernel.cpp (working copy) @@ -192,6 +192,7 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader ) { QString to, cc, bcc, subj, body; + QCStringList customHeaders; KURL messageFile; KURL::List attachURLs; bool mailto = false; @@ -252,6 +253,8 @@ attachURLs += KURL( QString::fromLocal8Bit( *it ) ); } + customHeaders = args->getOptionList("header"); + if (args->isSet("composer")) mailto = true; @@ -302,7 +305,7 @@ viewMessage( messageFile ); else action( mailto, checkMail, to, cc, bcc, subj, body, messageFile, - attachURLs ); + attachURLs, customHeaders ); return true; } @@ -366,7 +369,8 @@ const QString &bcc, const QString &subject, const QString &body, int hidden, const KURL &messageFile, - const KURL::List &attachURLs) + const KURL::List &attachURLs, + const QCStringList &customHeaders) { kdDebug(5006) << "KMKernel::openComposer called" << endl; KMMessage *msg = new KMMessage; @@ -389,6 +393,23 @@ else if (!body.isEmpty()) msg->setBody(body.utf8()); + if (!customHeaders.isEmpty()) + { + for ( QCStringList::ConstIterator it = customHeaders.begin() ; it != customHeaders.end() ; ++it ) + if ( !(*it).isEmpty() ) + { + int pos = (*it).find( ':' ); + if ( pos > 0 ) + { + QCString header, value; + header = (*it).left( pos ); header = header.stripWhiteSpace(); + value = (*it).mid( pos+1 ); value = value.stripWhiteSpace(); + if ( header.length() && value.length() ) + msg->setHeaderField( header, value ); + } + } + } + KMail::Composer * cWin = KMail::makeComposer( msg ); cWin->setCharset("", TRUE); for ( KURL::List::ConstIterator it = attachURLs.begin() ; it != attachURLs.end() ; ++it ) @@ -1802,14 +1823,15 @@ const QString &cc, const QString &bcc, const QString &subj, const QString &body, const KURL &messageFile, - const KURL::List &attachURLs) + const KURL::List &attachURLs, + const QCStringList &customHeaders) { - if (mailto) - openComposer (to, cc, bcc, subj, body, 0, messageFile, attachURLs); + if ( mailto ) + openComposer( to, cc, bcc, subj, body, 0, messageFile, attachURLs, customHeaders ); else openReader( check ); - if (check) + if ( check ) checkMail(); //Anything else? } --Boundary-00=_fXQLFHKPwhj2Yyv Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail developers mailing list KMail-devel@kde.org https://mail.kde.org/mailman/listinfo/kmail-devel --Boundary-00=_fXQLFHKPwhj2Yyv--