Capabilities Capabilities::fromResponse( const Response & ehlo ) { Capabilities c; // first, check whether the response was valid and indicates success: if ( !ehlo.isOk() || ehlo.code() / 10 != 25 // ### restrict to 250 only? || ehlo.lines().empty() ) return c; QCStringList l = ehlo.lines(); for ( QCStringList::const_iterator it = ++l.constBegin() ; it != l.constEnd() ; ++it ) c.add( QString::fromLatin1(*it) ); return c; }