This file is indexed.

/usr/include/mailtransport/servertest.h is in kdepimlibs5-dev 4:4.14.10-7+b2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/*
  Copyright (C) 2007 KovoKs <info@kovoks.nl>
  Copyright (c) 2008 Thomas McGuire <thomas.mcguire@gmx.net>

  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Library General Public License as published by
  the Free Software Foundation; either version 2 of the License, or (at your
  option) any later version.

  This library is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
  License for more details.

  You should have received a copy of the GNU Library General Public License
  along with this library; see the file COPYING.LIB.  If not, write to the
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.
*/

#ifndef MAILTRANSPORT_SERVERTEST_H
#define MAILTRANSPORT_SERVERTEST_H

#include <mailtransport/mailtransport_export.h>
#include <mailtransport/transport.h>

#include <QWidget>
#include <QtCore/QHash>

class QProgressBar;

namespace MailTransport {

class ServerTestPrivate;

/**
 * @class ServerTest
 * This class can be used to test certain server to see if they support stuff.
 * @author Tom Albers <tomalbers@kde.nl>
 */
class MAILTRANSPORT_EXPORT ServerTest : public QWidget
{
  Q_OBJECT
  Q_PROPERTY( QString server READ server WRITE setServer )
  Q_PROPERTY( QString protocol READ protocol WRITE setProtocol )
  Q_PROPERTY( QProgressBar *progressBar READ progressBar WRITE setProgressBar )

  public:

    /**
     * This enumeration has the special capabilities a server might
     * support. This covers only capabilities not related to authentication.
     * @since 4.1
     */
    enum Capability {
      Pipelining, ///< POP3 only. The server supports pipeplining of commands
      Top,        ///< POP3 only. The server supports fetching only the headers
      UIDL        ///< POP3 only. The server has support for unique identifiers
    };

    /**
     * Creates a new server test.
     *
     * @param parent The parent widget.
     */
    ServerTest( QWidget *parent = 0 );

    /**
     * Destroys the server test.
     */
    ~ServerTest();

    /**
     * Sets the server to test.
     */
    void setServer( const QString &server );

    /**
     * Returns the server to test.
     */
    QString server();

    /**
     * Set a custom port to use.
     *
     * Each encryption mode (no encryption or SSL) has a different port.
     * TLS uses the same port as no encryption, because TLS is invoked during
     * a normal session.
     *
     * If this function is never called, the default port is used, which is:
     * (normal first, then SSL)
     * SMTP: 25, 465
     * POP: 110, 995
     * IMAP: 143, 993
     *
     * @param encryptionMode the port will only be used in this encryption mode.
     *                       Valid values for this are only 'None' and 'SSL'.
     * @param port the port to use
     *
     * @since 4.1
     */
    void setPort( Transport::EnumEncryption::type encryptionMode, uint port );

    /**
     * @param encryptionMode the port of this encryption mode is returned.
     *                       Can only be 'None' and 'SSL'
     *
     * @return the port set by @ref setPort or -1 if @ref setPort() was never
     *         called for this encryption mode.
     *
     * @since 4.1
     */
    int port( Transport::EnumEncryption::type encryptionMode );

    /**
     * Sets a fake hostname for the test. This is currently only used when
     * testing a SMTP server; there, the command for testing the capabilities
     * (called EHLO) needs to have the hostname of the client included.
     * The user can however choose to send a fake hostname instead of the
     * local hostname to work around various problems. This fake hostname needs
     * to be set here.
     *
     * @param fakeHostname the fake hostname to send
     */
    void setFakeHostname( const QString &fakeHostname );

    /**
     * @return the fake hostname, as set before with @ref setFakeHostname
     */
    QString fakeHostname();

    /**
     * Makes @p pb the progressbar to use. This class will call show()
     * and hide() and will count down. It does not take ownership of
     * the progressbar.
     */
    void setProgressBar( QProgressBar *pb );

    /**
     * Returns the used progress bar.
     */
    QProgressBar *progressBar();

    /**
     * Sets @p protocol the protocol to test, currently supported are
     * "smtp", "pop" and "imap".
     */
    void setProtocol( const QString &protocol );

    /**
     * Returns the protocol.
     */
    QString protocol();

    /**
     * Starts the test. Will emit finished() when done.
     */
    void start();

    /**
     * Get the protocols for the normal connections.. Call this only
     * after the finished() signals has been sent.
     * @return an enum of the type Transport::EnumAuthenticationType
     */
    QList<int> normalProtocols();

    /**
     * tells you if the normal server is available
     * @since 4.5
     */
    bool isNormalPossible();

    /**
     * Get the protocols for the TLS connections. Call this only
     * after the finished() signals has been sent.
     * @return an enum of the type Transport::EnumAuthenticationType
     * @since 4.1
     */
    QList<int> tlsProtocols();

    /**
     * Get the protocols for the SSL connections. Call this only
     * after the finished() signals has been sent.
     * @return an enum of the type Transport::EnumAuthenticationType
     */
    QList<int> secureProtocols();

    /**
     * tells you if the ssl server is available
     * @since 4.5
     */
    bool isSecurePossible();

    /**
     * Get the special capabilities of the server.
     * Call this only after the finished() signals has been sent.
     *
     * @return the list of special capabilities of the server.
     * @since 4.1
     */
    QList<Capability> capabilities() const;

  Q_SIGNALS:
    /**
     * This will be emitted when the test is done. It will contain
     * the values from the enum EnumEncryption which are possible.
     */
    void finished( QList<int> );

  private:
    Q_DECLARE_PRIVATE( ServerTest )
    ServerTestPrivate *const d;

    Q_PRIVATE_SLOT( d, void slotNormalPossible() )
    Q_PRIVATE_SLOT( d, void slotTlsDone() )
    Q_PRIVATE_SLOT( d, void slotSslPossible() )
    Q_PRIVATE_SLOT( d, void slotReadNormal( const QString &text ) )
    Q_PRIVATE_SLOT( d, void slotReadSecure( const QString &text ) )
    Q_PRIVATE_SLOT( d, void slotNormalNotPossible() )
    Q_PRIVATE_SLOT( d, void slotSslNotPossible() )
    Q_PRIVATE_SLOT( d, void slotUpdateProgress() )
};

} // namespace MailTransport

#endif // MAILTRANSPORT_SERVERTEST_H