This file is indexed.

/usr/include/ptlib/mail.h is in libpt-1.10.10-dev 1.10.10-3.1ubuntu1.

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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
/*
 * mail.h
 *
 * Electronic Mail abstraction class.
 *
 * Portable Windows Library
 *
 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 * the License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is Portable Windows Library.
 *
 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
 *
 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
 * All Rights Reserved.
 *
 * Contributor(s): ______________________________________.
 *
 * $Log: mail.h,v $
 * Revision 1.14  2005/11/25 03:43:47  csoutheren
 * Fixed function argument comments to be compatible with Doxygen
 *
 * Revision 1.13  2003/09/17 05:41:58  csoutheren
 * Removed recursive includes
 *
 * Revision 1.12  2003/09/17 01:18:02  csoutheren
 * Removed recursive include file system and removed all references
 * to deprecated coooperative threading support
 *
 * Revision 1.11  2002/09/16 01:08:59  robertj
 * Added #define so can select if #pragma interface/implementation is used on
 *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
 *
 * Revision 1.10  2001/05/22 12:49:32  robertj
 * Did some seriously wierd rewrite of platform headers to eliminate the
 *   stupid GNU compiler warning about braces not matching.
 *
 * Revision 1.9  1999/03/09 02:59:50  robertj
 * Changed comments to doc++ compatible documentation.
 *
 * Revision 1.8  1999/02/16 08:12:00  robertj
 * MSVC 6.0 compatibility changes.
 *
 * Revision 1.7  1999/02/10 13:20:53  robertj
 * Added ability to have attachments in mail messages.
 *
 * Revision 1.6  1998/09/23 06:20:51  robertj
 * Added open source copyright license.
 *
 * Revision 1.5  1997/05/16 12:14:08  robertj
 * Added BCC capability to send mail.
 *
 * Revision 1.4  1995/07/02 01:19:46  robertj
 * Change GetMessageBidy to return BOOL and have body string as
 *   parameter, due to slight change in semantics for large bodies.
 *
 * Revision 1.3  1995/06/17 00:42:22  robertj
 * Added mail reading interface.
 * Changed name to simply PMail
 *
 * Revision 1.2  1995/04/01 08:27:57  robertj
 * Added GUI support.
 *
 * Revision 1.1  1995/03/14  12:44:11  robertj
 * Initial revision
 *
 */

#ifndef _PMAIL
#define _PMAIL

#ifdef P_USE_PRAGMA
#pragma interface
#endif

#ifdef _WIN32

#  ifndef P_HAS_MAPI
#  define P_HAS_MAPI 1
#  endif

#  ifndef P_HAS_CMC
#  define P_HAS_CMC 1
#  endif

#  if P_HAS_MAPI
#  include <mapi.h>
#  endif

#  if P_HAS_CMC
#  include <xcmc.h>
#  endif

#endif  // _WIN32


/**This class establishes a mail session with the platforms mail system.
*/
class PMail : public PObject
{
  PCLASSINFO(PMail, PObject);

  public:
  /**@name Construction */
  //@{
    /**Create a mail session. It is initially not logged in.
     */
    PMail();

    /**Create a mail session.
       Attempt to log in using the parameters provided.
     */
    PMail(
      const PString & username,  ///< User withing mail system to use.
      const PString & password   ///< Password for user in mail system.
    );

    /**Create a mail session.
       Attempt to log in using the parameters provided.
     */
    PMail(
      const PString & username,  ///< User withing mail system to use.
      const PString & password,  ///< Password for user in mail system.
      const PString & service
      /**A platform dependent string indicating the location of the underlying
         messaging service, eg the path to a message store or node name of the
         mail server.
       */
    );


    virtual ~PMail();
    /* Destroy the mail session, logging off the mail system if necessary.
     */
  //@}

  /**@name Log in/out functions */
  //@{
    /**Attempt to log on to the mail system using the parameters provided.

       @return
       TRUE if successfully logged on.
     */
    BOOL LogOn(
      const PString & username,  ///< User withing mail system to use.
      const PString & password   ///< Password for user in mail system.
    );

    /**Attempt to log on to the mail system using the parameters provided.

       @return
       TRUE if successfully logged on.
     */
    BOOL LogOn(
      const PString & username,  ///< User withing mail system to use.
      const PString & password,  ///< Password for user in mail system.
      const PString & service
      /**A platform dependent string indicating the location of the underlying
         messaging service, eg the path to a message store or node name of the
         mail server.
       */
    );

    /**Log off from the mail system.

       @return
       TRUE if successfully logged off.
     */
    virtual BOOL LogOff();

    /**Determine if the mail session is active and logged into the mail system.

       @return
       TRUE if logged into the mail system.
     */
    BOOL IsLoggedOn() const;
  //@}

  /**@name Send message functions */
  //@{
    /**Send a new simple mail message.

       @return
       TRUE if the mail message was successfully queued. Note that this does
       {\bf not} mean that it has been delivered.
     */
    BOOL SendNote(
      const PString & recipient,  ///< Name of recipient of the mail message.
      const PString & subject,    ///< Subject name for the mail message.
      const char * body           ///< Text body of the mail message.
    );

    /**Send a new simple mail message.

       @return
       TRUE if the mail message was successfully queued. Note that this does
       {\bf not} mean that it has been delivered.
     */
    BOOL SendNote(
      const PString & recipient,  ///< Name of recipient of the mail message.
      const PString & subject,    ///< Subject name for the mail message.
      const char * body,          ///< Text body of the mail message.
      const PStringList & attachments
                        ///< List of files to attach to the mail message.
    );

    /**Send a new simple mail message.

       @return
       TRUE if the mail message was successfully queued. Note that this does
       {\bf not} mean that it has been delivered.
     */
    BOOL SendNote(
      const PString & recipient,  ///< Name of recipient of the mail message.
      const PStringList & carbonCopies, ///< Name of CC recipients.
      const PStringList & blindCarbons, ///< Name of BCC recipients.
      const PString & subject,        ///< Subject name for the mail message.
      const char * body,              ///< Text body of the mail message.
      const PStringList & attachments
                        ///< List of files to attach to the mail message.
    );
  //@}

  /**@name Read message functions */
  //@{
    /**Get a list of ID strings for all messages in the mail box.

       @return
       An array of ID strings.
     */
    PStringArray GetMessageIDs(
      BOOL unreadOnly = TRUE    ///< Only get the IDs for unread messages.
    );

    /// Message header for each mail item.
    struct Header {
      /// Subject for message.
      PString  subject;           
      /// Full name of message originator.
      PString  originatorName;    
      /// Return address of message originator.
      PString  originatorAddress; 
      /// Time message received.
      PTime    received;          
    };

    /**Get the header information for a message.

       @return
       TRUE if header information was successfully obtained.
     */
    BOOL GetMessageHeader(
      const PString & id,      ///< Identifier of message to get header.
      Header & hdrInfo         ///< Header info for the message.
    );

    /**Get the body text for a message into the #body# string
       parameter.

       Note that if the body text for the mail message is very large, the
       function will return FALSE. To tell between an error getting the message
       body and having a large message body the #GetErrorCode()# function
       must be used.

       To get a large message body, the #GetMessageAttachments()# should
       be used with the #includeBody# parameter set to TRUE so that
       the message body is placed into a disk file.

       @return
       TRUE if the body text was retrieved, FALSE if the body was too large or
       some other error occurred.
     */
    BOOL GetMessageBody(
      const PString & id,      ///< Identifier of message to get body.
      PString & body,          ///< Body text of mail message.
      BOOL markAsRead = FALSE  ///< Mark the message as read.
    );

    /**Get all of the attachments for a message as disk files.

       @return
       TRUE if attachments were successfully obtained.
     */
    BOOL GetMessageAttachments(
      const PString & id,       ///< Identifier of message to get attachments.
      PStringArray & filenames, ///< File names for each attachment.
      BOOL includeBody = FALSE, ///< Include the message body as first attachment
      BOOL markAsRead = FALSE   ///< Mark the message as read
    );

    /**Mark the message as read.

       @return
       TRUE if message was successfully marked as read.
     */
    BOOL MarkMessageRead(
      const PString & id      ///< Identifier of message to get header.
    );

    /**Delete the message from the system.

       @return
       TRUE if message was successfully deleted.
     */
    BOOL DeleteMessage(
      const PString & id      ///< Identifier of message to get header.
    );
  //@}

  /**@name User look up functions */
  //@{
    /// Result of a lookup operation with the #LookUp()# function.
    enum LookUpResult {
      /// User name is unknown in mail system.
      UnknownUser,    
      /// User is ambiguous in mail system.
      AmbiguousUser,  
      /// User is a valid, unique name in mail system.
      ValidUser,      
      /// An error occurred during the look up
      LookUpError     
    };

    /**Look up the specified name and verify that they are a valid address in
       the mail system.

       @return
       result of the name lookup.
     */
    LookUpResult LookUp(
      const PString & name,  ///< Name to look up.
      PString * fullName = NULL
      /**String to receive full name of user passed in #name#. If
         NULL then the full name is {\bf not} returned.
       */
    );
  //@}

  /**@name Error functions */
  //@{
    /**Get the internal error code for the last error by a function in this
       mail session.

       @return
       integer error code for last operation.
     */
    int GetErrorCode() const;

    /**Get the internal error description for the last error by a function in
       this mail session.

       @return
       string error text for last operation.
     */
    PString GetErrorText() const;
  //@}


  protected:
    void Construct();
    // Common construction code.

    /// Flag indicating the session is active.
    BOOL loggedOn;


// Include platform dependent part of class
#ifdef _WIN32
#include "msos/ptlib/mail.h"
#else
#include "unix/ptlib/mail.h"
#endif
};

#endif

// End Of File ///////////////////////////////////////////////////////////////