• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • mailtransport
servertest.cpp
1 /*
2  Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
3  Copyright (C) 2007 KovoKs <info@kovoks.nl>
4  Copyright (c) 2008 Thomas McGuire <thomas.mcguire@gmx.net>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 // Own
23 #include "servertest.h"
24 #include "socket.h"
25 
26 #include <mailtransport/transportbase.h>
27 #include <mailtransport/mailtransport_defs.h>
28 
29 // Qt
30 #include <QHostInfo>
31 #include <QProgressBar>
32 #include <QTimer>
33 
34 // KDE
35 #include <KLocalizedString>
36 #include <KDebug>
37 
38 using namespace MailTransport;
39 
40 namespace MailTransport {
41 
42 class ServerTestPrivate
43 {
44  public:
45  ServerTestPrivate( ServerTest *test );
46 
47  ServerTest *const q;
48  QString server;
49  QString fakeHostname;
50  QString testProtocol;
51 
52  MailTransport::Socket *normalSocket;
53  MailTransport::Socket *secureSocket;
54 
55  QSet< int > connectionResults;
56  QHash< int, QList<int> > authenticationResults;
57  QSet< ServerTest::Capability > capabilityResults;
58  QHash< int, uint > customPorts;
59  QTimer *normalSocketTimer;
60  QTimer *secureSocketTimer;
61  QTimer *progressTimer;
62 
63  QProgressBar *testProgress;
64 
65  bool secureSocketFinished;
66  bool normalSocketFinished;
67  bool tlsFinished;
68  bool popSupportsTLS;
69  int normalStage;
70  int secureStage;
71  int encryptionMode;
72 
73  bool normalPossible;
74  bool securePossible;
75 
76  void finalResult();
77  void handleSMTPIMAPResponse( int type, const QString &text );
78  void sendInitialCapabilityQuery( MailTransport::Socket *socket );
79  bool handlePopConversation( MailTransport::Socket *socket, int type, int stage,
80  const QString &response, bool *shouldStartTLS );
81  QList< int > parseAuthenticationList( const QStringList &authentications );
82 
83  // slots
84  void slotNormalPossible();
85  void slotNormalNotPossible();
86  void slotSslPossible();
87  void slotSslNotPossible();
88  void slotTlsDone();
89  void slotReadNormal( const QString &text );
90  void slotReadSecure( const QString &text );
91  void slotUpdateProgress();
92 };
93 
94 }
95 
96 ServerTestPrivate::ServerTestPrivate( ServerTest *test )
97  : q( test ), testProgress( 0 ), secureSocketFinished( false ),
98  normalSocketFinished( false ), tlsFinished( false ),
99  normalPossible( true ), securePossible( true )
100 {
101 }
102 
103 void ServerTestPrivate::finalResult()
104 {
105  if ( !secureSocketFinished || !normalSocketFinished || !tlsFinished ) {
106  return;
107  }
108 
109  kDebug() << "Modes:" << connectionResults;
110  kDebug() << "Capabilities:" << capabilityResults;
111  kDebug() << "Normal:" << q->normalProtocols();
112  kDebug() << "SSL:" << q->secureProtocols();
113  kDebug() << "TLS:" << q->tlsProtocols();
114 
115  if ( testProgress ) {
116  testProgress->hide();
117  }
118  progressTimer->stop();
119  secureSocketFinished = false;
120  normalSocketFinished = false;
121  tlsFinished = false ;
122 
123  emit q->finished( connectionResults.toList() );
124 }
125 
126 QList< int > ServerTestPrivate::parseAuthenticationList( const QStringList &authentications )
127 {
128  QList< int > result;
129  for ( QStringList::ConstIterator it = authentications.begin();
130  it != authentications.end(); ++it ) {
131  QString current = ( *it ).toUpper();
132  if ( current == QLatin1String( "LOGIN" ) ) {
133  result << Transport::EnumAuthenticationType::LOGIN;
134  } else if ( current == QLatin1String( "PLAIN" ) ) {
135  result << Transport::EnumAuthenticationType::PLAIN;
136  } else if ( current == QLatin1String( "CRAM-MD5" ) ) {
137  result << Transport::EnumAuthenticationType::CRAM_MD5;
138  } else if ( current == QLatin1String( "DIGEST-MD5" ) ) {
139  result << Transport::EnumAuthenticationType::DIGEST_MD5;
140  } else if ( current == QLatin1String( "NTLM" ) ) {
141  result << Transport::EnumAuthenticationType::NTLM;
142  } else if ( current == QLatin1String( "GSSAPI" ) ) {
143  result << Transport::EnumAuthenticationType::GSSAPI;
144  } else if ( current == QLatin1String( "ANONYMOUS" ) ) {
145  result << Transport::EnumAuthenticationType::ANONYMOUS;
146  }
147  // APOP is handled by handlePopConversation()
148  }
149  kDebug() << authentications << result;
150 
151  // LOGIN doesn't offer anything over PLAIN, requires more server
152  // roundtrips and is not an official SASL mechanism, but a MS-ism,
153  // so only enable it if PLAIN isn't available:
154  if ( result.contains( Transport::EnumAuthenticationType::PLAIN ) ) {
155  result.removeAll( Transport::EnumAuthenticationType::LOGIN );
156  }
157 
158  return result;
159 }
160 
161 void ServerTestPrivate::handleSMTPIMAPResponse( int type, const QString &text )
162 {
163  if ( !text.contains( QLatin1String( "AUTH" ), Qt::CaseInsensitive ) ) {
164  kDebug() << "No authentication possible";
165  return;
166  }
167 
168  QStringList protocols;
169  protocols << QLatin1String( "LOGIN" ) << QLatin1String( "PLAIN" )
170  << QLatin1String( "CRAM-MD5" ) << QLatin1String( "DIGEST-MD5" )
171  << QLatin1String( "NTLM" ) << QLatin1String( "GSSAPI" )
172  << QLatin1String( "ANONYMOUS" );
173 
174  QStringList results;
175  for ( int i = 0; i < protocols.count(); ++i ) {
176  if ( text.contains( protocols.at( i ), Qt::CaseInsensitive ) ) {
177  results.append( protocols.at( i ) );
178  }
179  }
180 
181  authenticationResults[type] = parseAuthenticationList( results );
182 
183  // if we couldn't parse any authentication modes, default to clear-text
184  if ( authenticationResults[type].size() == 0 ) {
185  authenticationResults[type] << Transport::EnumAuthenticationType::CLEAR;
186  }
187 
188  kDebug() << "For type" << type << ", we have:" << authenticationResults[type];
189 }
190 
191 void ServerTestPrivate::slotNormalPossible()
192 {
193  normalSocketTimer->stop();
194  connectionResults << Transport::EnumEncryption::None;
195 }
196 
197 void ServerTestPrivate::sendInitialCapabilityQuery( MailTransport::Socket *socket )
198 {
199  if ( testProtocol == IMAP_PROTOCOL ) {
200  socket->write( QLatin1String( "1 CAPABILITY" ) );
201 
202  } else if ( testProtocol == SMTP_PROTOCOL ) {
203 
204  // Detect the hostname which we send with the EHLO command.
205  // If there is a fake one set, use that, otherwise use the
206  // local host name (and make sure it contains a domain, so the
207  // server thinks it is valid).
208  QString hostname;
209  if ( !fakeHostname.isNull() ) {
210  hostname = fakeHostname;
211  } else {
212  hostname = QHostInfo::localHostName();
213  if ( hostname.isEmpty() ) {
214  hostname = QLatin1String( "localhost.invalid" );
215  } else if ( !hostname.contains( QChar::fromLatin1( '.' ) ) ) {
216  hostname += QLatin1String( ".localnet" );
217  }
218  }
219  kDebug() << "Hostname for EHLO is" << hostname;
220 
221  socket->write( QLatin1String( "EHLO " ) + hostname );
222  }
223 }
224 
225 void ServerTestPrivate::slotTlsDone()
226 {
227 
228  // The server will not send a response after starting TLS. Therefore, we have to manually
229  // call slotReadNormal(), because this is not triggered by a data received signal this time.
230  slotReadNormal( QString() );
231 }
232 
233 bool ServerTestPrivate::handlePopConversation( MailTransport::Socket *socket, int type, int stage,
234  const QString &response, bool *shouldStartTLS )
235 {
236  Q_ASSERT( shouldStartTLS != 0 );
237 
238  // Initial Greeting
239  if ( stage == 0 ) {
240 
241  //Regexp taken from POP3 ioslave
242  QString responseWithoutCRLF = response;
243  responseWithoutCRLF.chop( 2 );
244  QRegExp re( QLatin1String( "<[A-Za-z0-9\\.\\-_]+@[A-Za-z0-9\\.\\-_]+>$" ),
245  Qt::CaseInsensitive );
246  if ( responseWithoutCRLF.indexOf( re ) != -1 ) {
247  authenticationResults[type] << Transport::EnumAuthenticationType::APOP;
248  }
249 
250  //Each server is supposed to support clear text login
251  authenticationResults[type] << Transport::EnumAuthenticationType::CLEAR;
252 
253  // If we are in TLS stage, the server does not send the initial greeting.
254  // Assume that the APOP availability is the same as with an unsecured connection.
255  if ( type == Transport::EnumEncryption::TLS &&
256  authenticationResults[Transport::EnumEncryption::None].
257  contains( Transport::EnumAuthenticationType::APOP ) ) {
258  authenticationResults[Transport::EnumEncryption::TLS]
259  << Transport::EnumAuthenticationType::APOP;
260  }
261 
262  socket->write( QLatin1String( "CAPA" ) );
263  return true;
264  }
265 
266  // CAPA result
267  else if ( stage == 1 ) {
268 // Example:
269 // CAPA
270 // +OK
271 // TOP
272 // USER
273 // SASL LOGIN CRAM-MD5
274 // UIDL
275 // RESP-CODES
276 // .
277  if ( response.contains( QLatin1String( "TOP" ) ) ) {
278  capabilityResults += ServerTest::Top;
279  }
280  if ( response.contains( QLatin1String( "PIPELINING" ) ) ) {
281  capabilityResults += ServerTest::Pipelining;
282  }
283  if ( response.contains( QLatin1String( "UIDL" ) ) ) {
284  capabilityResults += ServerTest::UIDL;
285  }
286  if ( response.contains( QLatin1String( "STLS" ) ) ) {
287  connectionResults << Transport::EnumEncryption::TLS;
288  popSupportsTLS = true;
289  }
290  socket->write( QLatin1String( "AUTH" ) );
291  return true;
292  }
293 
294  // AUTH response
295  else if ( stage == 2 ) {
296 // Example:
297 // C: AUTH
298 // S: +OK List of supported authentication methods follows
299 // S: LOGIN
300 // S: CRAM-MD5
301 // S:.
302  QString formattedReply = response;
303 
304  // Get rid of trailling ".CRLF"
305  formattedReply.chop( 3 );
306 
307  // Get rid of the first +OK line
308  formattedReply = formattedReply.right( formattedReply.size() -
309  formattedReply.indexOf( QLatin1Char( '\n' ) ) - 1 );
310  formattedReply =
311  formattedReply.replace( QLatin1Char( ' ' ), QLatin1Char( '-' ) ).
312  replace( QLatin1String( "\r\n" ), QLatin1String( " " ) );
313 
314  authenticationResults[type] +=
315  parseAuthenticationList( formattedReply.split( QLatin1Char( ' ' ) ) );
316  }
317 
318  *shouldStartTLS = popSupportsTLS;
319  return false;
320 }
321 
322 // slotReadNormal() handles normal (no) encryption and TLS encryption.
323 // At first, the communication is not encrypted, but if the server supports
324 // the STARTTLS/STLS keyword, the same authentication query is done again
325 // with TLS.
326 void ServerTestPrivate::slotReadNormal( const QString &text )
327 {
328  Q_ASSERT( encryptionMode != Transport::EnumEncryption::SSL );
329  static const int tlsHandshakeStage = 42;
330 
331  kDebug() << "Stage" << normalStage + 1 << ", Mode" << encryptionMode;
332 
333  // If we are in stage 42, we just do the handshake for TLS encryption and
334  // then reset the stage to -1, so that all authentication modes and
335  // capabilities are queried again for TLS encryption (some servers have
336  // different authentication methods in normal and in TLS mode).
337  if ( normalStage == tlsHandshakeStage ) {
338  Q_ASSERT( encryptionMode == Transport::EnumEncryption::TLS );
339  normalStage = -1;
340  normalSocket->startTLS();
341  return;
342  }
343 
344  bool shouldStartTLS = false;
345  normalStage++;
346 
347  // Handle the whole POP converstation separatly, it is very different from
348  // IMAP and SMTP
349  if ( testProtocol == POP_PROTOCOL ) {
350  if ( handlePopConversation( normalSocket, encryptionMode, normalStage, text,
351  &shouldStartTLS ) ) {
352  return;
353  }
354  } else {
355  // Handle the SMTP/IMAP conversation here. We just send the EHLO command in
356  // sendInitialCapabilityQuery.
357  if ( normalStage == 0 ) {
358  sendInitialCapabilityQuery( normalSocket );
359  return;
360  }
361 
362  if ( text.contains( QLatin1String( "STARTTLS" ), Qt::CaseInsensitive ) ) {
363  connectionResults << Transport::EnumEncryption::TLS;
364  shouldStartTLS = true;
365  }
366  handleSMTPIMAPResponse( encryptionMode, text );
367  }
368 
369  // If we reach here, the normal authentication/capabilities query is completed.
370  // Now do the same for TLS.
371  normalSocketFinished = true;
372 
373  // If the server announced that STARTTLS/STLS is available, we'll add TLS to the
374  // connection result, do the command and set the stage to 42 to start the handshake.
375  if ( shouldStartTLS && encryptionMode == Transport::EnumEncryption::None ) {
376  kDebug() << "Trying TLS...";
377  connectionResults << Transport::EnumEncryption::TLS;
378  if ( testProtocol == POP_PROTOCOL ) {
379  normalSocket->write( QLatin1String( "STLS" ) );
380  } else if ( testProtocol == IMAP_PROTOCOL ) {
381  normalSocket->write( QLatin1String( "2 STARTTLS" ) );
382  } else {
383  normalSocket->write( QLatin1String( "STARTTLS" ) );
384  }
385  encryptionMode = Transport::EnumEncryption::TLS;
386  normalStage = tlsHandshakeStage;
387  return;
388  }
389 
390  // If we reach here, either the TLS authentication/capabilities query is finished
391  // or the server does not support the STARTTLS/STLS command.
392  tlsFinished = true;
393  finalResult();
394 }
395 
396 void ServerTestPrivate::slotReadSecure( const QString &text )
397 {
398  secureStage++;
399  if ( testProtocol == POP_PROTOCOL ) {
400  bool dummy;
401  if ( handlePopConversation( secureSocket, Transport::EnumEncryption::SSL,
402  secureStage, text, &dummy ) ) {
403  return;
404  }
405  } else {
406  if ( secureStage == 0 ) {
407  sendInitialCapabilityQuery( secureSocket );
408  return;
409  }
410  handleSMTPIMAPResponse( Transport::EnumEncryption::SSL, text );
411  }
412  secureSocketFinished = true;
413  finalResult();
414 }
415 
416 void ServerTestPrivate::slotNormalNotPossible()
417 {
418  normalSocketTimer->stop();
419  normalPossible = false;
420  normalSocketFinished = true;
421  tlsFinished = true;
422  finalResult();
423 }
424 
425 void ServerTestPrivate::slotSslPossible()
426 {
427  secureSocketTimer->stop();
428  connectionResults << Transport::EnumEncryption::SSL;
429 }
430 
431 void ServerTestPrivate::slotSslNotPossible()
432 {
433  secureSocketTimer->stop();
434  securePossible = false;
435  secureSocketFinished = true;
436  finalResult();
437 }
438 
439 void ServerTestPrivate::slotUpdateProgress()
440 {
441  if ( testProgress ) {
442  testProgress->setValue( testProgress->value() + 1 );
443  }
444 }
445 
446 //---------------------- end private class -----------------------//
447 
448 ServerTest::ServerTest( QWidget *parent )
449  : QWidget( parent ), d( new ServerTestPrivate( this ) )
450 {
451  d->normalSocketTimer = new QTimer( this );
452  d->normalSocketTimer->setSingleShot( true );
453  connect( d->normalSocketTimer, SIGNAL(timeout()), SLOT(slotNormalNotPossible()) );
454 
455  d->secureSocketTimer = new QTimer( this );
456  d->secureSocketTimer->setSingleShot( true );
457  connect( d->secureSocketTimer, SIGNAL(timeout()), SLOT(slotSslNotPossible()) );
458 
459  d->progressTimer = new QTimer( this );
460  connect( d->progressTimer, SIGNAL(timeout()), SLOT(slotUpdateProgress()) );
461 }
462 
463 ServerTest::~ServerTest()
464 {
465  delete d;
466 }
467 
468 void ServerTest::start()
469 {
470  kDebug() << d;
471 
472  d->connectionResults.clear();
473  d->authenticationResults.clear();
474  d->capabilityResults.clear();
475  d->popSupportsTLS = false;
476  d->normalStage = -1;
477  d->secureStage = -1;
478  d->encryptionMode = Transport::EnumEncryption::None;
479  d->normalPossible = true;
480  d->securePossible = true;
481 
482  if ( d->testProgress ) {
483  d->testProgress->setMaximum( 20 );
484  d->testProgress->setValue( 0 );
485  d->testProgress->setTextVisible( true );
486  d->testProgress->show();
487  d->progressTimer->start( 1000 );
488  }
489 
490  d->normalSocket = new MailTransport::Socket( this );
491  d->secureSocket = new MailTransport::Socket( this );
492  d->normalSocket->setObjectName( QLatin1String( "normal" ) );
493  d->normalSocket->setServer( d->server );
494  d->normalSocket->setProtocol( d->testProtocol );
495  if ( d->testProtocol == IMAP_PROTOCOL ) {
496  d->normalSocket->setPort( IMAP_PORT );
497  d->secureSocket->setPort( IMAPS_PORT );
498  } else if ( d->testProtocol == SMTP_PROTOCOL ) {
499  d->normalSocket->setPort( SMTP_PORT );
500  d->secureSocket->setPort( SMTPS_PORT );
501  } else if ( d->testProtocol == POP_PROTOCOL ) {
502  d->normalSocket->setPort( POP_PORT );
503  d->secureSocket->setPort( POPS_PORT );
504  }
505 
506  if ( d->customPorts.contains( Transport::EnumEncryption::None ) ) {
507  d->normalSocket->setPort( d->customPorts.value( Transport::EnumEncryption::None ) );
508  }
509  if ( d->customPorts.contains( Transport::EnumEncryption::SSL ) ) {
510  d->secureSocket->setPort( d->customPorts.value( Transport::EnumEncryption::SSL ) );
511  }
512 
513  connect( d->normalSocket, SIGNAL(connected()), SLOT(slotNormalPossible()) );
514  connect( d->normalSocket, SIGNAL(failed()), SLOT(slotNormalNotPossible()) );
515  connect( d->normalSocket, SIGNAL(data(QString)),
516  SLOT(slotReadNormal(QString)) );
517  connect( d->normalSocket, SIGNAL(tlsDone()), SLOT(slotTlsDone()));
518  d->normalSocket->reconnect();
519  d->normalSocketTimer->start( 10000 );
520 
521  d->secureSocket->setObjectName( QLatin1String( "secure" ) );
522  d->secureSocket->setServer( d->server );
523  d->secureSocket->setProtocol( d->testProtocol + QLatin1Char( 's' ) );
524  d->secureSocket->setSecure( true );
525  connect( d->secureSocket, SIGNAL(connected()), SLOT(slotSslPossible()) );
526  connect( d->secureSocket, SIGNAL(failed()), SLOT(slotSslNotPossible()) );
527  connect( d->secureSocket, SIGNAL(data(QString)),
528  SLOT(slotReadSecure(QString)) );
529  d->secureSocket->reconnect();
530  d->secureSocketTimer->start( 10000 );
531 }
532 
533 void ServerTest::setFakeHostname( const QString &fakeHostname )
534 {
535  d->fakeHostname = fakeHostname;
536 }
537 
538 QString ServerTest::fakeHostname()
539 {
540  return d->fakeHostname;
541 }
542 
543 void ServerTest::setServer( const QString &server )
544 {
545  d->server = server;
546 }
547 
548 void ServerTest::setPort( Transport::EnumEncryption::type encryptionMode, uint port )
549 {
550  Q_ASSERT( encryptionMode == Transport::EnumEncryption::None ||
551  encryptionMode == Transport::EnumEncryption::SSL );
552  d->customPorts.insert( encryptionMode, port );
553 }
554 
555 void ServerTest::setProgressBar( QProgressBar *pb )
556 {
557  d->testProgress = pb;
558 }
559 
560 void ServerTest::setProtocol( const QString &protocol )
561 {
562  d->testProtocol = protocol;
563 }
564 
565 QString ServerTest::protocol()
566 {
567  return d->testProtocol;
568 }
569 
570 QString ServerTest::server()
571 {
572  return d->server;
573 }
574 
575 int ServerTest::port( Transport::EnumEncryption::type encryptionMode )
576 {
577  Q_ASSERT( encryptionMode == Transport::EnumEncryption::None ||
578  encryptionMode == Transport::EnumEncryption::SSL );
579  if ( d->customPorts.contains( encryptionMode ) ) {
580  return d->customPorts.value( static_cast<int>( encryptionMode ) );
581  } else {
582  return -1;
583  }
584 }
585 
586 QProgressBar *ServerTest::progressBar()
587 {
588  return d->testProgress;
589 }
590 
591 QList< int > ServerTest::normalProtocols()
592 {
593  return d->authenticationResults[TransportBase::EnumEncryption::None];
594 }
595 
596 bool ServerTest::isNormalPossible()
597 {
598  return d->normalPossible;
599 }
600 
601 QList< int > ServerTest::tlsProtocols()
602 {
603  return d->authenticationResults[TransportBase::EnumEncryption::TLS];
604 }
605 
606 QList< int > ServerTest::secureProtocols()
607 {
608  return d->authenticationResults[Transport::EnumEncryption::SSL];
609 }
610 
611 bool ServerTest::isSecurePossible()
612 {
613  return d->securePossible;
614 }
615 
616 QList< ServerTest::Capability > ServerTest::capabilities() const
617 {
618  return d->capabilityResults.toList();
619 }
620 
621 #include "moc_servertest.cpp"
MailTransport::ServerTest::setFakeHostname
void setFakeHostname(const QString &fakeHostname)
Sets a fake hostname for the test.
Definition: servertest.cpp:533
MailTransport::ServerTest::setServer
void setServer(const QString &server)
Sets the server to test.
Definition: servertest.cpp:543
MailTransport::ServerTest::Top
POP3 only. The server supports fetching only the headers.
Definition: servertest.h:57
MailTransport::Socket::write
virtual void write(const QString &text)
Write text to the socket.
Definition: socket.cpp:178
MailTransport::ServerTest
This class can be used to test certain server to see if they support stuff.
Definition: servertest.h:41
MailTransport::ServerTest::isNormalPossible
bool isNormalPossible()
tells you if the normal server is available
Definition: servertest.cpp:596
MailTransport::ServerTest::setProtocol
void setProtocol(const QString &protocol)
Sets protocol the protocol to test, currently supported are &quot;smtp&quot;, &quot;pop&quot; and &quot;imap&quot;.
Definition: servertest.cpp:560
MailTransport::ServerTest::ServerTest
ServerTest(QWidget *parent=0)
Creates a new server test.
Definition: servertest.cpp:448
MailTransport::ServerTest::isSecurePossible
bool isSecurePossible()
tells you if the ssl server is available
Definition: servertest.cpp:611
MailTransport::ServerTest::setPort
void setPort(Transport::EnumEncryption::type encryptionMode, uint port)
Set a custom port to use.
Definition: servertest.cpp:548
MailTransport::ServerTest::port
int port(Transport::EnumEncryption::type encryptionMode)
Definition: servertest.cpp:575
MailTransport::ServerTest::capabilities
QList< Capability > capabilities() const
Get the special capabilities of the server.
Definition: servertest.cpp:616
MailTransport::ServerTest::~ServerTest
~ServerTest()
Destroys the server test.
Definition: servertest.cpp:463
MailTransport::Socket
Responsible for communicating with the server, it&#39;s designed to work with the ServerTest class...
Definition: socket.h:37
mailtransport_defs.h
Internal file containing constant definitions etc.
MailTransport::ServerTest::server
QString server()
Returns the server to test.
MailTransport::ServerTest::Pipelining
POP3 only. The server supports pipeplining of commands.
Definition: servertest.h:56
MailTransport::ServerTest::progressBar
QProgressBar * progressBar()
Returns the used progress bar.
MailTransport::ServerTest::protocol
QString protocol()
Returns the protocol.
MailTransport::ServerTest::normalProtocols
QList< int > normalProtocols()
Get the protocols for the normal connections.
Definition: servertest.cpp:591
MailTransport::ServerTest::start
void start()
Starts the test.
Definition: servertest.cpp:468
MailTransport::ServerTest::tlsProtocols
QList< int > tlsProtocols()
Get the protocols for the TLS connections.
Definition: servertest.cpp:601
MailTransport::ServerTest::setProgressBar
void setProgressBar(QProgressBar *pb)
Makes pb the progressbar to use.
Definition: servertest.cpp:555
MailTransport::ServerTest::UIDL
POP3 only. The server has support for unique identifiers.
Definition: servertest.h:58
MailTransport::ServerTest::fakeHostname
QString fakeHostname()
Definition: servertest.cpp:538
MailTransport::ServerTest::secureProtocols
QList< int > secureProtocols()
Get the protocols for the SSL connections.
Definition: servertest.cpp:606
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:01 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal